Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- code/third_party/vMaterials_2/Composite/Carbon_Fiber.mdlAdded+578
- code/third_party/vMaterials_2/Composite/Fiberglass.mdlAdded+394
- code/third_party/vMaterials_2/Composite/Fiberglass_Imperfections.mdlAdded+878
- code/third_party/vMaterials_2/Gems/Alexandrite.mdlAdded+102
- code/third_party/vMaterials_2/Gems/Amethyst.mdlAdded+136
- code/third_party/vMaterials_2/Gems/Ametrine.mdlAdded+161
- code/third_party/vMaterials_2/Gems/Aquamarine.mdlAdded+92
- code/third_party/vMaterials_2/Gems/Citrine.mdlAdded+133
- code/third_party/vMaterials_2/Gems/Diamond.mdlAdded+235
- code/third_party/vMaterials_2/Gems/Emerald.mdlAdded+93
- code/third_party/vMaterials_2/Gems/Garnet.mdlAdded+147
- code/third_party/vMaterials_2/Gems/Iolite.mdlAdded+91
- code/third_party/vMaterials_2/Gems/Jade.mdlAdded+133
- code/third_party/vMaterials_2/Gems/Morganite.mdlAdded+91
- code/third_party/vMaterials_2/Gems/Onyx.mdlAdded+157
- code/third_party/vMaterials_2/Gems/Pearl.mdlAdded+121
- code/third_party/vMaterials_2/Gems/Peridot.mdlAdded+91
- code/third_party/vMaterials_2/Gems/Ruby.mdlAdded+146
- code/third_party/vMaterials_2/Gems/Sapphire.mdlAdded+148
- code/third_party/vMaterials_2/Gems/Tanzanite.mdlAdded+94
- code/third_party/vMaterials_2/Gems/Topaz.mdlAdded+145
- code/third_party/vMaterials_2/Gems/Tourmaline.mdlAdded+181
- code/third_party/vMaterials_2/Gems/Turquoise.mdlAdded+719
- code/third_party/vMaterials_2/Gems/Zircon.mdlAdded+140
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_10_of_12.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_11_of_12.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_2_of_12.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_3_of_12.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_4_of_12.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_5_of_12.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_6_of_12.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_7_of_12.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_8_of_12.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_9_of_12.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum_Glossy_Fingerprints.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum_Polished.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Coated.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Dirty.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Scratched.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Shiny.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Smudges.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Gold.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Grass_Green.pngAdded
- code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Lavender.pngAdded
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::base::*;import ::df::*;import ::math::*;import ::state::*;import ::tex::*;import ::nvidia::core_definitions::blend_colors;import ::nvidia::core_definitions::dimension;
const string COPYRIGHT = " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
const string DESCRIPTION = "A polished brass material with tweakable surface imperfections.";
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_linearfloat3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()){ // http://blog.selfshadow.com/publications/blending-in-detail/ float3 n_t = transform_internal_to_tangent(n); float3 nd_t = transform_internal_to_tangent(nd);
n_t=n_t + float3(0.,0.,1.); nd_t = nd_t * float3(-1.,-1.,1.); n = n_t*math::dot(n_t, nd_t)/n_t.z - nd_t; return ::math::normalize(transform_tangent_to_internal(n));}
float histogram_range(float input, float range = 1.0f, float position = 0.5f){ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); float high = ::math::clamp(math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); return ::math::lerp(low, high, input);}
float remap(float input, float low, float high){ return ::math::lerp(low, high, input);}
::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::anisotropy_return anisotropy_conversion( float roughness = 0.0, float anisotropy = 0.0, float anisotropy_rotation = 0.0, float3 tangent_u = ::state::texture_tangent_u(0)){ ::base::anisotropy_return return_value( roughness_u: roughness * roughness, roughness_v: roughness * roughness, tangent_u: tangent_u );
if (anisotropy > 0.f) { // Allows for infinite anisotropy when roughness==0, full roughness when anisotropy==0 (saturated later on) return_value.roughness_u += ::math::pow(anisotropy,4);
if (anisotropy_rotation > 0.f && anisotropy_rotation < 1.f) { float3 tangent_v = ::math::cross(::state::normal(), tangent_u); // assumed these are normalized already float rotation_angle = 2.f * ::math::PI * anisotropy_rotation; return_value.tangent_u = tangent_u * ::math::cos(rotation_angle) - tangent_v * ::math::sin(rotation_angle); } }
return_value.roughness_u = ::math::min(1.f, return_value.roughness_u); return_value.roughness_v = ::math::min(1.f, return_value.roughness_v); return return_value;}
::base::texture_coordinate_info vmat_transform( uniform float2 translation = float2(0.0, 0.0), uniform float rotation = 0.0, uniform float2 scaling = float2(1.0, 1.0), uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, uniform int uv_space = 0){ float4x4 scale = float4x4(1.0 /scaling.x, 0. , 0. , 0., 0. , 1.0 /scaling.y , 0. , 0., 0. , 0. , 1.0, 0., translation.x , translation.y , 0.0, 1.);
float s = ::math::sin(rotation); float c = ::math::cos(rotation); float4x4 rotate = float4x4( c , -s , 0.0 , 0.0, s , c , 0.0 , 0.0, 0.0, 0.0 , 1.0 , 0.0, 0. , 0.0 , 0.0 , 1.); return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));}
float 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_pos_range(float input, float range, float position){ float range_half = range/2.0; float add_high = (position - range_half) < 0.0 ? ::math::abs(position - range_half) : 0.0; float subtract_low = (position + range_half) > 1.0 ? ::math::abs((position + range_half)-1.0) : 0.0; float low = (position - range_half) < 0.0 ? 0.0 : (position - range_half - subtract_low); float high = (position + range_half) > 1.0 ? 1.0 : (position + range_half + add_high); return remap(input, low, high);}
export material Carbon_Fiber( float carbon_fiber_brightness = 0.22f [[ ::anno::description("Adjusts the brightness of the material."), ::anno::display_name("Brightness"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(0) ]], float fibers_roughness = 0.16f [[ ::anno::description("Afjusts the roughness of the fibers."), ::anno::display_name("Fibers Roughness"), ::anno::in_group("Appearance", "Fibers"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(1) ]], float fibers_anisotropy = 0.18f [[ ::anno::description("Adjusts the anisotropy of the fibers. Higher values stretches the reflection of the fibers."), ::anno::display_name("Fibers Anisotropy"), ::anno::in_group("Appearance", "Fibers"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(2) ]], uniform float weaving_bump_strength = 1.f [[ ::anno::description("Adjusts the bumpiness of the weaving pattern."), ::anno::display_name("Weaving Bump Strength"), ::anno::in_group("Appearance", "Fibers"), ::anno::hard_range(0.f, 2.f), ::anno::soft_range(0.f, 1.f), ::anno::ui_order(3) ]], uniform bool enable_coating = false [[ ::anno::description("When enables, a a transparent coating is applied on top of the carbon fiber."), ::anno::display_name("Enable Coating"), ::anno::in_group("Coating"), ::anno::ui_order(4) ]], float coating_roughness = 0.f [[ ::anno::description("Adjusts the roughness of the coating. Higher values lead to blurrier reflections."), ::anno::display_name("Coating Roughness"), ::anno::in_group("Coating"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(5) ]], float coating_roughness_variation = 0.36f [[ ::anno::description("This parameter adds variation to the roughness so that it appears less uniform."), ::anno::display_name("Coating Roughness Variation"), ::anno::in_group("Coating"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(6) ]], uniform float coating_damages_intensity = 0.02f [[ ::anno::description("Adds scratches and wear on the coating."), ::anno::display_name("Coating Damages"), ::anno::in_group("Coating"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(7) ]], float coating_damages_scale = .75f [[ ::anno::description("Use this parameter to make the damages bigger or smaller, relative to the overall texture scale."), ::anno::display_name("Damages Scale"), ::anno::in_group("Coating"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(8) ]], float coating_dust = 0.23f [[ ::anno::description("Adds a thin layer of dust which makes the surface a bit more matte when applied."), ::anno::display_name("Coating Dust"), ::anno::in_group("Coating"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(9) ]], uniform float2 texture_translate = float2(0.f) [[ ::anno::description("Controls the position of the texture."), ::anno::display_name("Texture Translate"), ::anno::in_group("Transform"), ::anno::ui_order(10) ]], uniform float texture_rotate = 0.f [[ ::anno::description("Rotates angle of the texture in degrees."), ::anno::display_name("Texture Rotate"), ::anno::in_group("Transform"), ::anno::soft_range(0.f, 360.f), ::anno::ui_order(11) ]], uniform float2 texture_scale = float2(1.f) [[ ::anno::description("Larger numbers increase the size."), ::anno::display_name("Texture Scale"), ::anno::in_group("Transform"), ::nvidia::core_definitions::dimension(float2(.60f, .60f)), ::preview_scale(2.5f), ::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) ]], 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(16) ]])[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Carbon Fiber - Shiny Uncoated"), ::anno::description(DESCRIPTION), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber.png"), ::anno::key_words(string[]("fabric", "composite", "woven", "new", "bumped", "design", "automotive", "black", "dark", "neutral"))]] = let { bool tmp0 = true; material_surface tmp1(enable_coating ? ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf((float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y * coating_dust + ::math::max(::math::lerp(::math::lerp(0.f, 0.300000012f, coating_roughness), coating_roughness * ::base::file_texture(texture_2d("./textures/generic_surface_rough.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 * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, histogram_range(coating_roughness_variation, 0.229999989f, 0.300000012f)), float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x * coating_damages_intensity)) * (float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y * coating_dust + ::math::max(::math::lerp(::math::lerp(0.f, 0.300000012f, coating_roughness), coating_roughness * ::base::file_texture(texture_2d("./textures/generic_surface_rough.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 * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, histogram_range(coating_roughness_variation, 0.229999989f, 0.300000012f)), float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x * coating_damages_intensity)), (float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y * coating_dust + ::math::max(::math::lerp(::math::lerp(0.f, 0.300000012f, coating_roughness), coating_roughness * ::base::file_texture(texture_2d("./textures/generic_surface_rough.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 * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, histogram_range(coating_roughness_variation, 0.229999989f, 0.300000012f)), float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x * coating_damages_intensity)) * (float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y * coating_dust + ::math::max(::math::lerp(::math::lerp(0.f, 0.300000012f, coating_roughness), coating_roughness * ::base::file_texture(texture_2d("./textures/generic_surface_rough.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 * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).mono, histogram_range(coating_roughness_variation, 0.229999989f, 0.300000012f)), float3(::base::file_texture(texture_2d("./textures/surface_damages_multi_R_rough_B_rough2.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x * coating_damages_intensity)), 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.0700000003f, ::df::diffuse_transmission_bsdf(color(::math::pow(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.48999998f, 0.560000002f), 2.20000005f))), ::df::custom_curve_layer(carbon_fiber_brightness * 0.300000012f + 0.0199999996f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).roughness_u, anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).roughness_v, color(1.f, 1.f, 1.f), color(0.737910986f, 0.737910986f, 0.737910986f), anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).tangent_u, ::df::scatter_reflect), ::df::weighted_layer(0.219999999f, ::df::diffuse_reflection_bsdf(color(::math::pow(histogram_pos_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.469999999f, 0.149999991f), 2.20000005f)), 0.f), bsdf(), ::state::normal()), add_detail_normal(::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_fibers_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::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/carbon_fiber_weaving_norm.png", ::tex::gamma_linear), weaving_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.25f)), 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))), add_detail_normal(::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_fibers_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::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/carbon_fiber_weaving_norm.png", ::tex::gamma_linear), weaving_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.25f)), 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/surface_damages_norm.jpg", ::tex::gamma_linear), coating_damages_intensity * 0.5f, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(coating_damages_scale * 8.f)), 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)) : ::df::weighted_layer(0.0700000003f, ::df::diffuse_transmission_bsdf(color(::math::pow(histogram_scan_big(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.48999998f, 0.560000002f), 2.20000005f))), ::df::custom_curve_layer(carbon_fiber_brightness * 0.300000012f + 0.0199999996f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).roughness_u, anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).roughness_v, color(1.f, 1.f, 1.f), color(0.737910986f, 0.737910986f, 0.737910986f), anisotropy_conversion(histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.769999981f, ::math::lerp(0.300000012f, 0.550000012f, fibers_roughness)), histogram_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.789999962f, ::math::lerp(0.599999964f, 0.75f, fibers_anisotropy)), texture_rotate / 360.f + float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * 0.25f, ::state::texture_tangent_u(0)).tangent_u, ::df::scatter_reflect), ::df::weighted_layer(0.219999999f, ::df::diffuse_reflection_bsdf(color(::math::pow(histogram_pos_range(float3(::base::file_texture(texture_2d("./textures/carbon_fiber_multi_R_rough_G_cutout_B_patternA.jpg", ::tex::gamma_linear), color(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.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).x, 0.469999999f, 0.149999991f), 2.20000005f)), 0.f), bsdf(), ::state::normal()), add_detail_normal(::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_fibers_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::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/carbon_fiber_weaving_norm.png", ::tex::gamma_linear), weaving_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.25f)), 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))), add_detail_normal(::base::tangent_space_normal_texture(texture_2d("./textures/carbon_fiber_fibers_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::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/carbon_fiber_weaving_norm.png", ::tex::gamma_linear), weaving_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_scale * 0.075000003f, ::base::texture_coordinate_uvw, uv_space_index), float2(0.25f)), 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_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, true, float(roundcorners_across_materials)) : ::state::normal()); } in material( thin_walled: tmp0, surface: tmp1, backface: tmp2, ior: tmp3, volume: tmp4, geometry: tmp5, hair: hair_bsdf());
// 2export material Carbon_Fiber_Matte_Uncoated(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Carbon Fiber - Matte Uncoated"), ::anno::description(DESCRIPTION), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Matte_Uncoated.png"), ::anno::key_words(string[]("fabric", "composite", "woven", "new", "matte", "bumped", "design", "automotive", "black", "dark", "neutral"))]] = Carbon_Fiber( carbon_fiber_brightness: 0.22f, fibers_roughness: 0.75f, fibers_anisotropy: 0.18f, weaving_bump_strength: 1.0f, enable_coating: false, coating_roughness: 0.0f, coating_roughness_variation: 0.36f, coating_damages_intensity: 0.0f, coating_damages_scale: 1.00f, coating_dust: 0.23f, 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);
// 3export material Carbon_Fiber_Shiny_Coating(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Carbon Fiber - Shiny Coating"), ::anno::description(DESCRIPTION), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Shiny_Coating.png"), ::anno::key_words(string[]("fabric", "composite", "woven", "new", "coated", "smooth", "design", "automotive", "coated", "black", "dark", "neutral"))]] = Carbon_Fiber( carbon_fiber_brightness: 0.22f, fibers_roughness: 0.41f, fibers_anisotropy: 0.22f, weaving_bump_strength: 1.0f, enable_coating: true, coating_roughness: 0.0f, coating_roughness_variation: 0.36f, coating_damages_intensity: 0.0f, coating_damages_scale: 1.00f, coating_dust: 0.15f, 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);
// 4export material Carbon_Fiber_Worn_Coating(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Carbon Fiber - Worn Coating"), ::anno::description(DESCRIPTION), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Worn_Coating.png"), ::anno::key_words(string[]("fabric", "composite", "woven", "worn", "used", "old", "scratched", "shiny", "bumped", "design", "automotive", "coated", "black", "dark", "neutral"))]] = Carbon_Fiber( carbon_fiber_brightness: 0.22f, fibers_roughness: 0.41f, fibers_anisotropy: 0.18f, weaving_bump_strength: 1.0f, enable_coating: true, coating_roughness: 0.0f, coating_roughness_variation: 0.96f, coating_damages_intensity: 0.97f, coating_damages_scale: 1.00f, coating_dust: 0.73f, 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);
// 5export material Carbon_Fiber_Matte_Coating(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Carbon Fiber - Matte Coating"), ::anno::description(DESCRIPTION), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Matte_Coating.png"), ::anno::key_words(string[]("fabric", "composite", "woven", "new", "matte", "design", "automotive", "coated", "black", "dark", "neutral"))]] = Carbon_Fiber( carbon_fiber_brightness: 0.22f, fibers_roughness: 0.41f, fibers_anisotropy: 0.18f, weaving_bump_strength: 1.0f, enable_coating: true, coating_roughness: 0.74f, coating_roughness_variation: 0.36f, coating_damages_intensity: 0.0f, coating_damages_scale: 1.0f, coating_dust: 0.23f, 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);
//6export material Carbon_Fiber_Dusty_Coating(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Carbon Fiber - Dusty Coating"), ::anno::description(DESCRIPTION), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Dusty_Coating.png"), ::anno::key_words(string[]("fabric", "composite", "woven", "shiny", "bumped", "design", "automotive", "coated", "black", "dark", "neutral"))]] = Carbon_Fiber( carbon_fiber_brightness: 0.22f, fibers_roughness: 0.41f, fibers_anisotropy: 0.18f, weaving_bump_strength: 1.0f, enable_coating: true, coating_roughness: 0.08f, coating_roughness_variation: 0.5f, coating_damages_intensity: 0.12f, coating_damages_scale: 0.65f, coating_dust: 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);
//7export material Carbon_Fiber_Aluminized(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Carbon Fiber - Aluminized"), ::anno::description(DESCRIPTION), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Aluminized.png"), ::anno::key_words(string[]("fabric", "composite", "woven", "shiny", "bumped", "design", "automotive", "aluminum", "gray", "neutral"))]] = Carbon_Fiber( carbon_fiber_brightness: 0.58f, fibers_roughness: 0.41f, fibers_anisotropy: 0.18f, weaving_bump_strength: 1.3f, enable_coating: false, coating_roughness: 0.08f, coating_roughness_variation: 0.5f, coating_damages_intensity: 0.08f, coating_damages_scale: 0.65f, coating_dust: 0.05f, 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);
//8export material Carbon_Fiber_Aluminized_Coated(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Carbon Fiber - Aluminized Coated"), ::anno::description(DESCRIPTION), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Carbon_Fiber.Carbon_Fiber_Aluminized_Coated.png"), ::anno::key_words(string[]("fabric", "composite", "woven", "shiny", "bumped", "design", "automotive", "aluminum", "coated", "gray", "neutral"))]] = Carbon_Fiber( carbon_fiber_brightness: 0.58f, fibers_roughness: 0.41f, fibers_anisotropy: 0.18f, weaving_bump_strength: 1.3f, enable_coating: true, coating_roughness: 0.08f, coating_roughness_variation: 0.5f, coating_damages_intensity: 0.08f, coating_damages_scale: 0.65f, coating_dust: 0.05f, 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);123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.5;
import ::anno::*;import ::base::*;import ::df::*;import ::math::*;import ::state::*;import ::tex::*;import ::nvidia::core_definitions::blend_colors;import ::nvidia::core_definitions::dimension;
const string COPYRIGHT = " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
annotation preview_scale( float f);
::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_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(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);}
// 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_linearfloat3 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 Fiberglass( float fibers_shininess = 0.5f [[ ::anno::description("Makes the fiber glass material duller or shinier. Default value is 0.5."), ::anno::display_name("Fibers Shininess"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(0) ]], color fiberglass_tint = color(.8f) [[ ::anno::description("Tints the glass fiber material."), ::anno::display_name("Fiberglass Tint"), ::anno::in_group("Appearance", "Diffuse"), ::anno::ui_order(1) ]], uniform float weaving_bump_strength = 1.0f [[ ::anno::description("Determines the degree of bumpiness."), ::anno::display_name("Weaving Bump Strength"), ::anno::in_group("Appearance", "Bump"), ::anno::soft_range(0.f, 1.f), ::anno::hard_range(0.f, 3.f), ::anno::ui_order(2) ]], uniform float fibers_bump_strength = 1.f [[ ::anno::description("Determines the degree of bumpiness of the fibers."), ::anno::display_name("Fibers Bump Strength"), ::anno::in_group("Appearance", "Bump"), ::anno::hard_range(0.f, 3.f), ::anno::soft_range(0.f, 1.f), ::anno::ui_order(3) ]], float diffuse_brightness = 0.61f [[ ::anno::description("The diffuse brightness of the fibers."), ::anno::display_name("Diffuse Brightness"), ::anno::in_group("Appearance", "Advanced"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(5) ]], float specular_weight = 1.f [[ ::anno::description("The amount of glossiness variation for the vertical fiber glossiness."), ::anno::display_name("Specular Weight"), ::anno::in_group("Appearance", "Advanced"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(4) ]], float diffuse_transmission_weight = 0.21f [[ ::anno::description("Weight of the diffuse transmission."), ::anno::display_name("Diffuse Transmission Weight"), ::anno::in_group("Appearance", "Advanced"), ::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(10) ]], 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(11) ]], 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(2.5f), ::anno::ui_order(12) ]], uniform int uv_space_index = 0 [[ ::anno::description("The UV space to use for the texture mapping."), ::anno::display_name("UV Space Index"), ::anno::in_group("Advanced"), ::anno::ui_order(13) ]])[[ ::anno::description("A fiberglass material."), ::anno::display_name("Fiberglass"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Fiberglass.Fiberglass.png"), ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "white", "light", "neutral")), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland")]] = let { float2 texture_rescale = texture_scale * 0.1f; bool tmp0 = false; material_surface tmp1(::df::weighted_layer(diffuse_transmission_weight, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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, 0.810000002f)), fiberglass_tint, ::base::color_layer_multiply, 1.f).tint), ::df::custom_curve_layer(specular_weight, 1.f, 5.f, histogram_scan(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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.f, 0.469999999f), ::df::microfacet_ggx_smith_bsdf(::math::max(::math::smoothstep(0.789999962f, 0.790999949f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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]) * histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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.389999986f, 0.0799999982f, fibers_shininess)), histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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.800000012f, 0.5f, fibers_shininess)) * ::math::min(1.f - ::math::smoothstep(0.50999999f, 0.539999962f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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]), ::math::smoothstep(0.340000004f, 0.389999986f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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]))), ::math::max(::math::smoothstep(0.789999962f, 0.790999949f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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]) * histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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.800000012f, 0.5f, fibers_shininess)), histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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.389999986f, 0.0799999982f, fibers_shininess)) * ::math::min(1.f - ::math::smoothstep(0.50999999f, 0.539999962f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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]), ::math::smoothstep(0.340000004f, 0.389999986f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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]))), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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, diffuse_brightness)), fiberglass_tint, ::base::color_layer_multiply, 1.f).tint, 0.f), ::state::normal()), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); color tmp3 = color(1.f, 1.f, 1.f); material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)); material_geometry tmp5(float3(0.f), ::math::smoothstep(0.0299999993f, 0.0309999995f, float3(::base::file_texture(texture_2d("./textures/fiberglass_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear), 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]), add_detail_normal(::base::file_bump_texture(texture_2d("./textures/fiberglass_bump.jpg", ::tex::gamma_linear), fibers_bump_strength, ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, ::state::normal(), false), ::base::tangent_space_normal_texture(texture_2d("./textures/fiberglass_norm.jpg", ::tex::gamma_linear), weaving_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))); hair_bsdf tmp6 = hair_bsdf(); } in material( thin_walled: tmp0, surface: tmp1, backface: tmp2, ior: tmp3, volume: tmp4, geometry: tmp5, hair: tmp6);
export material Fiberglass_Flat_Weave(*)[[ ::anno::description("A fiberglass material."), ::anno::display_name("Fiberglass Flat Weave"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Fiberglass.Fiberglass_Flat_Weave.png"), ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "white", "light", "neutral")), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland")]] = Fiberglass( fibers_shininess: 0.5f, fiberglass_tint: color(.85f), weaving_bump_strength: 0.3f, fibers_bump_strength: 1.0f, specular_weight: 1.0f, diffuse_brightness: 0.7f, diffuse_transmission_weight: 0.21f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0);
export material Fiberglass_Shiny(*)[[ ::anno::description("A fiberglass material."), ::anno::display_name("Fiberglass Shiny"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Fiberglass.Fiberglass_Shiny.png"), ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "white", "light", "neutral")), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland")]] = Fiberglass( fibers_shininess: 1.0f, fiberglass_tint: color(.8f), weaving_bump_strength: 0.75f, fibers_bump_strength: 1.0f, specular_weight: 1.0f, diffuse_brightness: 0.75f, diffuse_transmission_weight: 0.21f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0);
export material Fiberglass_Yellowish(*)[[ ::anno::description("A fiberglass material."), ::anno::display_name("Fiberglass Yellowish"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Fiberglass.Fiberglass_Yellowish.png"), ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "yellow", "light", "neutral")), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland")]] = Fiberglass( fibers_shininess: 0.0f, fiberglass_tint: color(0.875138f, 0.812241f, 0.348865f), weaving_bump_strength: 0.75f, fibers_bump_strength: 1.0f, specular_weight: 1.0f, diffuse_brightness: 0.75f, diffuse_transmission_weight: 0.21f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0);
export material Fiberglass_Blueish(*)[[ ::anno::description("A fiberglass material."), ::anno::display_name("Fiberglass Blueish"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Fiberglass.Fiberglass_Blueish.png"), ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "white", "blue", "light", "neutral")), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland")]] = Fiberglass( fibers_shininess: 0.0f, fiberglass_tint: color(0.744530f, 0.915750f, 0.957370f), weaving_bump_strength: 0.75f, fibers_bump_strength: .75f, specular_weight: 1.0f, diffuse_brightness: 0.75f, diffuse_transmission_weight: 0.21f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0);123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.5;
import ::anno::*;import ::base::*;import ::df::*;import ::math::*;import ::state::*;import ::tex::*;import ::nvidia::core_definitions::blend_colors;import ::nvidia::core_definitions::dimension;
const string COPYRIGHT = " Copyright 2024 NVIDIA Corporation. All rights reserved.\n"" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
annotation preview_scale( float f);
::base::texture_coordinate_info warped_coordinate(// uniform texture_2d warp_texture, float warp_value, float amount, float angle, ::base::texture_coordinate_info uvw = ::base::coordinate_source()){ uvw.position = float3(uvw.position.x + amount * warp_value * ::math::sin(angle), uvw.position.y + amount * warp_value * ::math::cos(angle), uvw.position.z ); return uvw;}
::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 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 rotate_around(float2 uv, float angle, float2 pt){ float sine = ::math::sin(angle); float cosine = ::math::cos(angle); float2x2 rot = float2x2(cosine, -sine, sine, cosine); uv -= pt; uv = rot * uv ; return uv + pt;}
float2 scale_around(float2 uv, float2 scale, float2 pt){ float2x2 rot = float2x2(scale.x, 0., 0., scale.y); uv -= pt; uv = rot * uv; return uv + pt;}
float scatter_grayscale( uniform texture_2d pattern_texture = texture_2d(), uniform texture_2d mask_texture = texture_2d(), uniform texture_2d bluenoise_texture = texture_2d(), float pattern_size = 1.0f, // The size of the pattern float pattern_brightness = 1.0f, float pattern_brightness_variation = 0.0, // amount of color randomization int compute_size = 1, // bigger grid size is required when texture is scaled larger but is more expensive float random_mask_threshold = 0.0f, // higher values cause certain cells not to be rendered bool use_true_random_masking = false, // vs. using the blue noise texture that spaces the particles more venely apart from each other ::base::texture_coordinate_info uvw = ::base::coordinate_source(), // UVW coordinates to be used to lay the bombing over float2 texture_scale = float2(30.0f, 30.0f), float2 offset_randomization = float2(.5), // amount of position randomization. Larger values will require "compute_size" to be // increased, otherwise the texture will be clipped float rotation = 0.0, // amount of global rotation float rotation_randomization = 0.5, // amount of rotation randomization float scale_randomization = 0.0, // amount of scaling randomization bool additive_blend = false, // when false, mode is "max", otherwise "add/sub", centered at 0.5 // MASK bool enable_grayscale_mask = false, float grayscale_mask_threshold = 0.0, int seed = 0){ float result = 0.0; float4 grayscale_mask_lookup = 0.0f; float masking_value = 0.0; compute_size = compute_size < 1 ? 1 : compute_size; float2 uv = float2(uvw.position.x, uvw.position.y) * texture_scale;
for(float i = -compute_size; i <= compute_size; i++) for(float j = -compute_size; j <= compute_size; j++) { float2 p = ::math::floor(uv + float2(i, j)); float2 f = ::math::frac(uv) - float2(i, j); //float4 rand_4f = rnd42(int2(p)); int r1, r2, r3, r4, r5; // get random values r1 = lowbias32(lowbias32(seed) + int(p[0]) + lowbias32(int(p[1]))); r2 = lowbias32(r1); r3 = lowbias32(r2); r4 = lowbias32(r3); r5 = lowbias32(r4); float rnd1, rnd2, rnd3, rnd4, rnd5; rnd1 = uint2float(r1)/ 4294967296.f; rnd2 = uint2float(r2)/ 4294967296.f; rnd3 = uint2float(r3)/ 4294967296.f; rnd4 = uint2float(r4)/ 4294967296.f; rnd5 = uint2float(r5)/ 4294967296.f; f+= (float2(rnd1, rnd2) - float2(0.5f)) * offset_randomization; float2 rand_2f_remap = (float2(rnd3, rnd4) - float2( .5f)) * 2.0f; // center around - 1.0 - 1.0 f = rotate_around(f, (rotation + rand_2f_remap.x * rotation_randomization) * 3.1415, float2(0.5)); f = scale_around(f, float2(1.0 + rand_2f_remap.y * scale_randomization)/ pattern_size, float2(0.5));
int blue_noise_width = ::tex::width(bluenoise_texture); int blue_noise_height = ::tex::height(bluenoise_texture); // switch between completely random mask and mask mrovided by blue noise texture masking_value = use_true_random_masking ? rnd4 : ::tex::texel_float4(bluenoise_texture, int2(int(::math::floor(p.x))%blue_noise_width, int(::math::floor(p.y))%blue_noise_height)).x; if (enable_grayscale_mask == true) { // compute exact center of cells for the masking before it is being offset. We are not computing the mask // at the position where the element that is being scattered is ending up. That could be an alternative mode to be implemented. float2 cell_size = float2(1.0/texture_scale); grayscale_mask_lookup = ::tex::lookup_float4(mask_texture, float2(cell_size/2 + cell_size * p)); } bool mask_pass = (grayscale_mask_lookup.x > grayscale_mask_threshold) || enable_grayscale_mask == false; if(f.x >= 0.0 && f.x < 1.0 && f.y >= 0.0 && f.y < 1.0 && mask_pass && random_mask_threshold < masking_value) { float4 lookup = ::tex::lookup_float4(pattern_texture, float2(f), ::tex::wrap_repeat, ::tex::wrap_repeat, float2(0.0, 1.0), float2(0.0, 1.0)); // do blending of lookup // if (blend_add_sub == true) // { // value = (lookup.x + lookup.y + lookup.z)/3 - 0.5; // result = ::math::clamp(result + value * (1.0 - rand_4f.z * pattern_brightness_variation), 0.0f, 1.0f); // } // else if (additive_blend == true) result = result + (lookup.x + lookup.y + lookup.z)/3 * (1.0 - rnd5 * pattern_brightness_variation)*pattern_brightness; else result = ::math::max((lookup.x + lookup.y + lookup.z)/3 * (1.0 - rnd5 * pattern_brightness_variation)*pattern_brightness, result); } }
return result;}
float scatter_atlas_grayscale( uniform texture_2d pattern_atlas_texture = texture_2d(), uniform texture_2d mask_texture = texture_2d(), uniform texture_2d bluenoise_texture = texture_2d(), uniform int atlas_size = 2, int min_pattern = 1, int max_pattern = 4, float pattern_size = 1.0f, // The size of the pattern float pattern_brightness = 1.0f, float pattern_brightness_variation = 0.0, // amount of color randomization int compute_size = 1, // bigger grid size is required when texture is scaled larger but is more expensive float random_mask_threshold = 0.0f, // higher values cause certain cells not to be rendered bool use_true_random_masking = false, // vs. using the blue noise texture that spaces the particles more venely apart from each other ::base::texture_coordinate_info uvw = ::base::coordinate_source(), // UVW coordinates to be used to lay the bombing over float2 texture_scale = float2(30.0f, 30.0f), float2 offset_randomization = float2(.5), // amount of position randomization. Larger values will require "compute_size" to be // increased, otherwise the texture will be clipped float rotation = 0.0, // amount of global rotation float rotation_randomization = 0.5, // amount of rotation randomization float scale_randomization = 0.0, // amount of scaling randomization bool additive_blend = false, // when false, mode is "max", otherwise "add/sub", centered at 0.5 // MASK bool enable_grayscale_mask = false, float grayscale_mask_threshold = 0.0, int seed = 0){ float result = 0.0; float4 grayscale_mask_lookup = 0.0f; float masking_value = 0.0; compute_size = compute_size < 1 ? 1 : compute_size; float atlas_tile_size = 1.0f/atlas_size; // dimension of a single atlas tile float2 uv = float2(uvw.position.x, uvw.position.y) * texture_scale;
for(float i = -compute_size; i <= compute_size; i++) for(float j = -compute_size; j <= compute_size; j++) { float2 p = ::math::floor(uv + float2(i, j)); float2 f = ::math::frac(uv) - float2(i, j); //float4 rand_4f = rnd42(int2(p)); int r1, r2, r3, r4, r5; // get random values r1 = lowbias32(lowbias32(seed) + int(p[0]) + lowbias32(int(p[1]))); r2 = lowbias32(r1); r3 = lowbias32(r2); r4 = lowbias32(r3); r5 = lowbias32(r4); float rnd1, rnd2, rnd3, rnd4, rnd5; rnd1 = uint2float(r1)/ 4294967296.f; rnd2 = uint2float(r2)/ 4294967296.f; rnd3 = uint2float(r3)/ 4294967296.f; rnd4 = uint2float(r4)/ 4294967296.f; rnd5 = uint2float(r5)/ 4294967296.f; f+= (float2(rnd1, rnd2) - float2(0.5f)) * offset_randomization; float2 rand_2f_remap = (float2(rnd3, rnd4) - float2( .5f)) * 2.0f; // center around - 1.0 - 1.0 float rot_angle = (rotation + rand_2f_remap.x * rotation_randomization) * 3.1415; f = rotate_around(f, rot_angle, float2(0.5)); f = scale_around(f, float2(1.0 + rand_2f_remap.y * scale_randomization)/ pattern_size, float2(0.5));
int blue_noise_width = ::tex::width(bluenoise_texture); int blue_noise_height = ::tex::height(bluenoise_texture); // switch between completely random mask and mask mrovided by blue noise texture masking_value = use_true_random_masking ? rnd4 : ::tex::texel_float4(bluenoise_texture, int2(int(::math::floor(p.x))%blue_noise_width, int(::math::floor(p.y))%blue_noise_height)).x; if (enable_grayscale_mask == true) { // compute exact center of cells for the masking before it is being offset. We are not computing the mask // at the position where the element that is being scattered is ending up. That could be an alternative mode to be implemented. float2 cell_size = float2(1.0/texture_scale); grayscale_mask_lookup = ::tex::lookup_float4(mask_texture, float2(cell_size/2 + cell_size * p)); } bool mask_pass = (grayscale_mask_lookup.x > grayscale_mask_threshold) || enable_grayscale_mask == false; if(f.x >= 0.0 && f.x < 1.0 && f.y >= 0.0 && f.y < 1.0 && mask_pass && random_mask_threshold < masking_value) { // compute atlas tile from random number and derive tile coordinates from that
float atlas_tile = ::math::floor(::math::lerp(float(min_pattern), float(max_pattern+1), rnd5)); float div = (atlas_tile/atlas_size); float remainder = div - ::math::floor(div); // Perform lookup in the range that was selected float2 lookup_uv = float2(::math::lerp(::math::floor(div) * atlas_tile_size, ::math::floor(div) * atlas_tile_size + atlas_tile_size, f.x), ::math::lerp(remainder, remainder + atlas_tile_size, f.y)); float4 lookup = ::tex::lookup_float4(pattern_atlas_texture, lookup_uv, ::tex::wrap_repeat, ::tex::wrap_repeat, float2(0.0, 1.0), float2(0.0, 1.0));
if (additive_blend == true) result = result + (lookup.x + lookup.y + lookup.z)/3 * (1.0 - rnd1 * pattern_brightness_variation)*pattern_brightness; else result = ::math::max((lookup.x + lookup.y + lookup.z)/3 * (1.0 - rnd1 * pattern_brightness_variation)*pattern_brightness, result); } }
return result;}
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(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);}
float3 normalmap_normal( uniform texture_2d texture, float factor = 1.0, ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()){ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor)));}
// Returns the normal n in tangent space, given n is in internal space.float3 transform_internal_to_tangent(float3 n)[[ ::anno::hidden() ]]{ return n.x* float3(::state::texture_tangent_u(0).x,::state::texture_tangent_v(0).x,::state::normal().x)+ n.y* float3(::state::texture_tangent_u(0).y,::state::texture_tangent_v(0).y,::state::normal().y)+ n.z* float3(::state::texture_tangent_u(0).z,::state::texture_tangent_v(0).z,::state::normal().z);}
// Returns the normal n in internal space, given n is in tangent space.float3 transform_tangent_to_internal(float3 n)[[ ::anno::hidden() ]]{ return ::state::texture_tangent_u(0) * n.x + ::state::texture_tangent_v(0) * n.y + ::state::normal() * n.z ;}
// Returns a normal by adding a detail normal to a global normal.// If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded// correctly with ::tex::gamma_linearfloat3 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 Fiberglass_Imperfections( int seed = 14 [[ ::anno::description("A random seed to randomize the imperfections."), ::anno::display_name("Random Seed"), ::anno::in_group("Appearance"), ::anno::ui_order(0) ]], color fiberglass_tint = color(0.812241f, 0.932277f, 0.957370f) [[ ::anno::description("Applies a colored tint to the fibers."), ::anno::display_name("Fiberglass Tint"), ::anno::in_group("Appearance", "Diffuse"), ::anno::ui_order(1) ]], float fibers_shininess = 1.f [[ ::anno::description("Makes the fiber glass material duller or shinier. Default value is 0.5."), ::anno::display_name("Fibers Shininess"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(2) ]], uniform float weaving_bump_strength = 0.75f [[ ::anno::description("Determines the degree of bumpiness for the weaving."), ::anno::display_name("Weaving Bump Strength"), ::anno::in_group("Appearance", "Bump"), ::anno::soft_range(0.f, 1.f), ::anno::hard_range(0.f, 3.f), ::anno::ui_order(3) ]], uniform float fibers_bump_strength = 1.f [[ ::anno::description("Determines the degree of bumpiness of the fibers."), ::anno::display_name("Fibers Bump Strength"), ::anno::in_group("Appearance", "Bump"), ::anno::hard_range(0.f, 3.f), ::anno::soft_range(0.f, 1.f), ::anno::ui_order(4) ]], float diffuse_brightness = 0.75f [[ ::anno::description("The diffuse brightness of the fibers."), ::anno::display_name("Diffuse Brightness"), ::anno::in_group("Appearance", "Advanced"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(5) ]], float specular_weight = 1.0f [[ ::anno::description("The amount of glossiness variation for the vertical fiber glossiness."), ::anno::display_name("Specular Weight"), ::anno::in_group("Appearance", "Advanced"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(6) ]], float diffuse_transmission_weight = 0.21f [[ ::anno::description("The amount of light being able to scatter through the fibers."), ::anno::display_name("Diffuse Transmission Weight"), ::anno::in_group("Appearance", "Advanced"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(7) ]], float bumps_and_dents_probability = 0.34f [[ ::anno::description("The probability of generating bumps appearing on the material. Higher values will generate more bumps and dents."), ::anno::display_name("Bumps Probability"), ::anno::in_group("Bumps and Dents"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(12) ]], float bumps_dents_density = 4.5f [[ ::anno::description("The density of the bumps and dents."), ::anno::display_name("Bumps Density"), ::anno::in_group("Bumps and Dents"), ::anno::soft_range(0.f, 8.f), ::anno::enable_if("bumps_and_dents_probability > 0.0"), ::anno::ui_order(13) ]], float bumps_kernel_size = 1.f [[ ::anno::description("The area that the bumped imperfection is covering."), ::anno::display_name("Bumped Kernel Size"), ::anno::in_group("Bumps and Dents"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("bumps_and_dents_probability > 0.0"), ::anno::ui_order(14) ]], float bumps_waves_size = 0.7f [[ ::anno::description("The dimension of the waves that bump and dent the surface."), ::anno::display_name("Bumps Wave Size"), ::anno::in_group("Bumps and Dents"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("bumps_and_dents_probability > 0.0"), ::anno::ui_order(15) ]], float bumps_dents_size_variation = 0.9f [[ ::anno::description("Size variation of the bump surface imperfection."), ::anno::display_name("Bumps Size Variation"), ::anno::in_group("Bumps and Dents"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("bumps_and_dents_probability > 0.0"), ::anno::ui_order(16) ]], float bumps_dents_intensity = 1.f [[ ::anno::description("Overall intensity of the bumps."), ::anno::display_name("Bumps Overall Intensity"), ::anno::in_group("Bumps and Dents"), ::anno::hard_range(0.f, 4.f), ::anno::enable_if("bumps_and_dents_probability > 0.0"), ::anno::ui_order(17) ]], float bumps_dents_intensity_variation = 1.0f [[ ::anno::description("The amount of variation that is applied to the intensitz of the bumps and dents."), ::anno::display_name("Bumps Intensity Variation"), ::anno::in_group("Bumps and Dents"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("bumps_and_dents_probability > 0.0"), ::anno::ui_order(18) ]], float deformation_probability = 0.5f [[ ::anno::description("The probability of fabric deformation appearing on the material. Higher values will generate more deformations."), ::anno::display_name("Deformations Probability"), ::anno::in_group("Deformations"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(19) ]], float deformations_density = 5.f [[ ::anno::description("The density of the deformations."), ::anno::display_name("Deformations Density"), ::anno::in_group("Deformations"), ::anno::soft_range(0.f, 8.f), ::anno::enable_if("deformation_probability > 0.0"), ::anno::ui_order(20) ]], float deformations_size = 1.f [[ ::anno::description("The area that the fabric deformationis covering."), ::anno::display_name("Deformations Kernel Size"), ::anno::in_group("Deformations"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("deformation_probability > 0.0"), ::anno::ui_order(21) ]], float deformations_size_variation = 0.25f [[ ::anno::description("The amount of size variation of the areas where fabric deformations appear."), ::anno::display_name("Deformations Size Variation"), ::anno::in_group("Deformations"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("deformation_probability > 0.0"), ::anno::ui_order(22) ]], float deformation_intensity = 0.31f [[ ::anno::description("The amount of deformation."), ::anno::display_name("Deformations Intensity"), ::anno::in_group("Deformations"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("deformation_probability > 0.0"), ::anno::ui_order(23) ]], float deformation_intensity_variation = 1.f [[ ::anno::description("The amount of random variation to areas where surface deformation appears."), ::anno::display_name("Deformations Intensity Variation"), ::anno::in_group("Deformations"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("deformation_probability > 0.0"), ::anno::ui_order(24) ]], float tearing_probability = 0.13f [[ ::anno::description("The probability tearing to on the material. Higher values will generate more tearings."), ::anno::display_name("Tearings Probability"), ::anno::in_group("Tearings"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(25) ]], float tearings_density = 3.15f [[ ::anno::description("The density of tearings appearing on the material."), ::anno::display_name("Tearings Density"), ::anno::in_group("Tearings"), ::anno::soft_range(0.f, 8.f), ::anno::enable_if("tearing_probability > 0.0"), ::anno::ui_order(26) ]], float tearings_size = 1.f [[ ::anno::description("The area that a tearing is covering."), ::anno::display_name("Tearings Kernel Size"), ::anno::in_group("Tearings"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("tearing_probability > 0.0"), ::anno::ui_order(27) ]], float tearing_size_variation = 0.36f [[ ::anno::description("Randomizes the size of the tearings."), ::anno::display_name("Tearings Size Variation"), ::anno::in_group("Tearings"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("tearing_probability > 0.0"), ::anno::ui_order(28) ]], float tearings_rotation = 0.f [[ ::anno::description("The overal rotation of the tearings."), ::anno::display_name("Tearings Rotation"), ::anno::in_group("Tearings"), ::anno::soft_range(0.f, 3.f), ::anno::enable_if("tearing_probability > 0.0"), ::anno::ui_order(29) ]], float tearings_rotation_randomization = 0.f [[ ::anno::description("The amount of random rotation of a tearing."), ::anno::display_name("Tearings Rotation Variation"), ::anno::in_group("Tearings"), ::anno::hard_range(0.f, 1.f), ::anno::enable_if("tearing_probability > 0.0"), ::anno::ui_order(30) ]], 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(31) ]], 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(32) ]], 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(33) ]], 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(34) ]])[[ ::anno::description("A fiberglass material with adjustable imperfections such as bumps, warps and tears."), ::anno::display_name("Fiberglass with Imperfections"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Fiberglass_Imperfections.Fiberglass_Imperfections.png"), ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "imperfection", "white")), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland")]] = let { float2 texture_rescale = texture_scale * 0.1f; texture_2d blue_noise_tex = texture_2d("./textures/fiber_blue_noise_placement_512x512.png", ::tex::gamma_linear); texture_2d rough_ao_mask_tex = texture_2d("./textures/fiber_multi_R_rough_G_ao_B_mask.jpg", ::tex::gamma_linear); texture_2d warp_direction_noise_tex = texture_2d("./textures/fiber_warp_direction_noise.jpg", ::tex::gamma_linear); texture_2d warps_tex = texture_2d("./textures/fiberglass_warps.jpg", ::tex::gamma_linear); texture_2d bump_tex = texture_2d("./textures/fiber_bump.jpg", ::tex::gamma_linear); texture_2d tears_tex = texture_2d("./textures/fiber_tears.png", ::tex::gamma_linear); texture_2d fiber_norm_tex = texture_2d("./textures/fiber_norm.jpg", ::tex::gamma_linear); texture_2d waves_norm_tex = texture_2d("./textures/fiber_waves_norm.jpg", ::tex::gamma_linear); texture_2d kernel_tex = texture_2d("./textures/fiber_kernel.jpg", ::tex::gamma_linear); bool tmp0 = false; material_surface tmp1(::df::weighted_layer(diffuse_transmission_weight, ::df::diffuse_transmission_bsdf(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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, 0.810000002f)), fiberglass_tint, ::base::color_layer_multiply, 1.f).tint, ""), ::df::custom_curve_layer(specular_weight, 1.f, 5.f, histogram_scan(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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.f, 0.469999999f), ::df::microfacet_ggx_smith_bsdf(::math::max(::math::smoothstep(0.790000021f, 0.791000009f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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]) * histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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.389999986f, 0.0799999982f, fibers_shininess)), histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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.800000012f, 0.5f, fibers_shininess)) * ::math::min(1.f - ::math::smoothstep(0.50999999f, 0.539999962f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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]), ::math::smoothstep(0.340000004f, 0.389999986f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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]))), ::math::max(::math::smoothstep(0.790000021f, 0.791000009f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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]) * histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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.800000012f, 0.5f, fibers_shininess)), histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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.389999986f, 0.0799999982f, fibers_shininess)) * ::math::min(1.f - ::math::smoothstep(0.50999999f, 0.539999962f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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]), ::math::smoothstep(0.340000004f, 0.389999986f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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]))), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color(histogram_range(float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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, diffuse_brightness)), fiberglass_tint, ::base::color_layer_multiply, 1.f).tint, 0.f, ""), ::state::normal()), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); color tmp3 = color(1.f, 1.f, 1.f); material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)); material_geometry tmp5(float3(0.f), ::math::min(::math::smoothstep(0.0299999993f, 0.0309999995f, float3(::base::file_texture(rough_ao_mask_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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]), 1.f - scatter_atlas_grayscale(tears_tex, texture_2d(), blue_noise_tex, 2, 0, 4, tearings_size * 2.f, 1.f, 0.f, 1, 1.f - tearing_probability * 0.100000001f, true, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index)), float2(tearings_density), float2(1.f), tearings_rotation, tearings_rotation_randomization, tearing_size_variation * 0.600000024f, false, false, 0.f, seed + 10)), add_detail_normal(::base::file_bump_texture(bump_tex, fibers_bump_strength, ::base::mono_average, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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, ::state::normal(), false), add_detail_normal(::base::tangent_space_normal_texture(fiber_norm_tex, weaving_bump_strength, false, false, warped_coordinate(scatter_atlas_grayscale(warps_tex, texture_2d(), blue_noise_tex, 2, 0, 4, deformations_size * 2.f, deformation_intensity, deformation_intensity_variation, 1, 1.f - deformation_probability * 0.100000001f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(deformations_density), float2(1.f), 0.f, 0.25f, deformations_size_variation * 0.600000024f, false, false, 0.f, seed + 11), 0.099999994f, ::base::file_texture(warp_direction_noise_tex, color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, vmat_transform(texture_translate, texture_rotate, texture_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).mono * 3.1415f, 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), normalmap_normal(waves_norm_tex, scatter_grayscale(kernel_tex, texture_2d(), blue_noise_tex, bumps_kernel_size * 3.f, 1.f, bumps_dents_intensity_variation, 3, 1.f - bumps_and_dents_probability * 0.200000003f, true, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(bumps_dents_density), float2(1.f, 0.98999995f), 0.f, 1.f, bumps_dents_size_variation * 0.600000024f, false, false, 0.f, seed) * bumps_dents_intensity, vmat_transform(texture_translate, texture_rotate, texture_rescale * (bumps_waves_size * 3.f + 0.25f), ::base::texture_coordinate_uvw, uv_space_index))))); hair_bsdf tmp6 = hair_bsdf(); } in material( thin_walled: tmp0, surface: tmp1, backface: tmp2, ior: tmp3, volume: tmp4, geometry: tmp5, hair: tmp6);
export material Fiberglass_Bumpy_Imperfections(*)[[ ::anno::description("A fiberglass material with adjustable imperfections such as bumps, warps and tears."), ::anno::display_name("Fiberglass with Bumpy Imperfections"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Fiberglass_Imperfections.Fiberglass_Bumpy_Imperfections.png"), ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "imperfection", "bumped", "bumpy", "white")), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland")]] = Fiberglass_Imperfections( seed: 14, fibers_shininess: 0.5f, fiberglass_tint: color(0.812241f, 0.932277f, 0.957370f), weaving_bump_strength: 0.75f, fibers_bump_strength: 1.0f, specular_weight: 1.0f, diffuse_brightness: 0.75f, diffuse_transmission_weight: 0.21f, bumps_and_dents_probability: 0.95f, bumps_dents_density: 5.5f, bumps_kernel_size: 1.0f, bumps_waves_size: 0.7f, bumps_dents_size_variation: 0.9f, bumps_dents_intensity: 1.0f, bumps_dents_intensity_variation: 1.0f, deformation_probability: 0.0f, deformations_density: 5.0f, deformations_size: 1.0f, deformations_size_variation: 0.25f, deformation_intensity: 0.31f, deformation_intensity_variation: 1.0f, tearing_probability: 0.0f, tearings_density: 2.8f, tearings_size: 1.0f, tearing_size_variation: 0.36, tearings_rotation: 0.0f, tearings_rotation_randomization: 0.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0);
export material Fiberglass_Torn_Imperfections(*)[[ ::anno::description("A fiberglass material with adjustable imperfections such as bumps, warps and tears."), ::anno::display_name("Fiberglass with Torn Imperfections"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Fiberglass_Imperfections.Fiberglass_Torn_Imperfections.png"), ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "imperfection", "torn", "white")), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland")]] = Fiberglass_Imperfections( seed: 14, fibers_shininess: 0.5f, fiberglass_tint: color(0.812241f, 0.932277f, 0.957370f), weaving_bump_strength: 0.75f, fibers_bump_strength: 1.0f, specular_weight: 1.0f, diffuse_brightness: 0.75f, diffuse_transmission_weight: 0.21f, bumps_and_dents_probability: 0.0f, bumps_dents_density: 4.5f, bumps_kernel_size: 1.0f, bumps_waves_size: 0.7f, bumps_dents_size_variation: 0.9f, bumps_dents_intensity: 1.0f, bumps_dents_intensity_variation: 1.0f, deformation_probability: 0.0f, deformations_density: 5.0f, deformations_size: 1.0f, deformations_size_variation: 0.25f, deformation_intensity: 0.31f, deformation_intensity_variation: 1.0f, tearing_probability: 0.47f, tearings_density: 3.15f, tearings_size: 1.0f, tearing_size_variation: 0.36, tearings_rotation: 0.0f, tearings_rotation_randomization: 0.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0);
export material Fiberglass_Warped_Imperfections(*)[[ ::anno::description("A fiberglass material with adjustable imperfections such as bumps, warps and tears."), ::anno::display_name("Fiberglass with Warped Imperfections"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Fiberglass_Imperfections.Fiberglass_Warped_Imperfections.png"), ::anno::key_words(string[]("fiber", "fiberglass", "artificial", "design", "fabric", "mesh", "woven", "synthetic", "imperfection", "warped", "white")), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland")]] = Fiberglass_Imperfections( seed: 14, fibers_shininess: 0.5f, fiberglass_tint: color(0.812241f, 0.932277f, 0.957370f), weaving_bump_strength: 0.75f, fibers_bump_strength: 1.0f, specular_weight: 1.0f, diffuse_brightness: 0.75f, diffuse_transmission_weight: 0.21f, bumps_and_dents_probability: 0.0f, bumps_dents_density: 4.5f, bumps_kernel_size: 1.0f, bumps_waves_size: 0.7f, bumps_dents_size_variation: 0.9f, bumps_dents_intensity: 1.0f, bumps_dents_intensity_variation: 1.0f, deformation_probability: 0.84f, deformations_density: 4.89f, deformations_size: 1.0f, deformations_size_variation: 0.25f, deformation_intensity: 0.31f, deformation_intensity_variation: 1.0f, tearing_probability: 0.47f, tearings_density: 3.15f, tearings_size: 1.0f, tearing_size_variation: 0.36, tearings_rotation: 0.0f, tearings_rotation_randomization: 0.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0);123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::nvidia::core_definitions::flex_material;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 Alexandrite( uniform color transmission_color = color ( 0.8901961f , 0.509804f , 1.f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.2039216f , 0.9137255f , 0.3803922f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]])[[ ::anno::display_name("Alexandrite"), ::anno::description("Alexandrite gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Alexandrite.Alexandrite.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "alexandrite", "green"))]]= ::nvidia::core_definitions::flex_material( base_color: color ( 1.f , 1.f , 1.f), diffuse_roughness: 0.f, is_metal: false, reflectivity: 1.f, reflection_roughness: 0.f, anisotropy: 0.f, anisotropy_rotation: 0.f, transparency: 1.f, transmission_color: transmission_color, volume_color: volume_color, transmission_roughness: 0.f, base_thickness: clarity * 0.015f, ior: 1.75f, thin_walled: false, normal: ::state::normal ());123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::df::*;import ::anno::*;import ::base::*;import ::math::*;import ::nvidia::core_definitions::thick_glass;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 Amethyst( color transmission_color = color ( 0.9647059f , 0.6862745f , 0.9647059f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.427451f , 0.1294118f , 0.4745098f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform bool dispersion = true [[ ::anno::display_name("Dispersion"), ::anno::description("Enable or disable the dispersion."), ::anno::in_group("Advanced") ]])[[ ::anno::display_name("Amethyst"), ::anno::description("Amethyst gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Amethyst.Amethyst.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "amethyst", "purple"))]] = let{ //color transmission_color = color(1.0); color glass_color = volume_color; float roughness = 0.0; float volume_ior = 1.54f; //uniform bool dispersion = true; uniform float abbe_number = 67.82f; uniform float base_thickness = clarity * 0.008f; float3 normal = state::normal(); bsdf glossy_bsdf = df::simple_glossy_bsdf( mode: df::scatter_reflect, tint: color(1.), roughness_u: roughness ); bsdf glossy_bsdf_transmission = df::simple_glossy_bsdf( mode: df::scatter_transmit, tint: transmission_color, roughness_u: roughness );} in material( thin_walled: false, surface: material_surface( df::weighted_layer( normal: normal, weight: 1., layer: df::color_fresnel_layer( layer: glossy_bsdf, base: glossy_bsdf_transmission, ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior) ) ) ), volume: material_volume( absorption_coefficient: (base_thickness <= 0)? color(0): math::log(glass_color) / -base_thickness ), ior: dispersion?base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior));123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::base::texture_return;import ::nvidia::core_definitions::blend;import ::nvidia::core_definitions::flex_material;import ::nvidia::core_definitions::flow_noise_texture;import ::nvidia::core_definitions::dimension;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 Ametrine( uniform color gem_transmission_color= color ( 0.8431373f , 0.6509804f , 0.8666667f) [[ ::anno::display_name("Gem Transmission Color"), ::anno::description("Gem color."), ::anno::in_group("Appearance") ]], uniform color vein_transmission_color = color ( 1.f , 0.9137255f , 0.5843138f) [[ ::anno::display_name("Vein Transmission Color"), ::anno::description("Vein Color."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.9647059f , 0.6431373f , 0.7882353f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of object."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform float3 texture_translate = float3 ( 0.f) [[ ::anno::display_name("Translate"), ::anno::description("Controls the position of the texture."), ::anno::in_group("Transform") ]], uniform float3 texture_rotate = float3 ( 0.f) [[ ::anno::display_name("Rotate"), ::anno::description("Rotates angle of the texture in degrees."), ::anno::in_group("Transform") ]], uniform float texture_scale = 1.f [[ ::anno::display_name("Scale"), ::anno::description("Larger numbers increase the texture size."), ::anno::in_group("Transform"), ::nvidia::core_definitions::dimension(0.04f) ]])[[ ::anno::display_name("Ametrine"), ::anno::description("Ametrine gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Ametrine.Ametrine.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "Ametrine"))]]= ::nvidia::core_definitions::blend( base: ::nvidia::core_definitions::flex_material( base_color: color ( 0.5f , 0.5f , 0.5f), diffuse_roughness: 0.f, is_metal: false, reflectivity: 1.f, reflection_roughness: 0.f, anisotropy: 0.f, anisotropy_rotation: 0.f, transparency: 1.f, transmission_color: gem_transmission_color, volume_color: volume_color, transmission_roughness: 0.f, base_thickness: clarity * 0.3f, ior: 1.6f, thin_walled: false, normal: ::state::normal ()), blend: ::nvidia::core_definitions::flex_material( base_color: color ( 1.f , 1.f , 1.f), diffuse_roughness: 0.f, is_metal: false, reflectivity: 1.f, reflection_roughness: 0.f, anisotropy: 0.f, anisotropy_rotation: 0.f, transparency: 1.f, transmission_color: vein_transmission_color, volume_color: volume_color, transmission_roughness: 0.f, base_thickness: clarity * 0.2f, ior: 1.6f, thin_walled: false, normal: ::state::normal ()), weight: ::nvidia::core_definitions::flow_noise_texture( color1: color ( 1.f , 1.f , 1.f), color2: color ( 0.f , 0.f , 0.f), object_space: true, texture_space: 0, noise_levels: 3, absolute_noise: false, phase: 0.f, level_gain: 3.f, level_scale: 1.f, level_progressive_u_scale: 0.3f, level_progressive_v_motion: 0.f, scaling: float3 ( (2.f / (texture_scale)) * 20.f , 0.f , 0.f), translation: texture_translate , rotation: float3 ( texture_rotate.x + 0.f , texture_rotate.y + 0.f , texture_rotate.z + 45.f)).mono);1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::nvidia::core_definitions::thick_glass;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 Aquamarine( color transmission_color = color(0.982251f, 0.982251f, 0.879622f) // vmat 1.7: ( 1.f , 1.f , 0.8823529f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.9294118f , 0.972549f , 0.9803922f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]])[[ ::anno::display_name("Aquamarine"), ::anno::description("Aquamarine gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Aquamarine.Aquamarine.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "Aquamarine"))]]= ::nvidia::core_definitions::thick_glass( transmission_color: transmission_color, glass_color: volume_color, roughness: 0.003f, ior: 1.57f, base_thickness: clarity * 0.001f, normal: ::state::normal ());123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::base::*;import ::math::*;import ::state::*;import ::df::*;import ::nvidia::core_definitions::thick_glass;
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 Citrine( color transmission_color = color (0.982251f, 0.982251f, 0.846873f) //vmat 1.7: ( 1.f , 1.f , 0.8509804f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 1.f , 0.8117647f , 0.4745098f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform bool dispersion = true [[ ::anno::display_name("Dispersion"), ::anno::description("Enable or disable the dispersion."), ::anno::in_group("Advanced") ]]
)[[ ::anno::display_name("Citrine"), ::anno::description("Citrine gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Citrine.Citrine.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "Citrine", "orange", "warm"))]] = let{ uniform color glass_color = volume_color; float roughness = 0.003f; uniform float volume_ior = 1.545f; //uniform bool dispersion = true; uniform float abbe_number = 67.82f; uniform float base_thickness = clarity * 0.01f; float3 normal = ::state::normal(); bsdf glossy_bsdf = ::df::simple_glossy_bsdf( mode: ::df::scatter_reflect, tint: color(1.), roughness_u: roughness ); bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf( mode: ::df::scatter_transmit, tint: transmission_color, roughness_u: roughness );} in material( thin_walled: false, surface: material_surface( ::df::weighted_layer( normal: normal, weight: 1., layer: ::df::color_fresnel_layer( layer: glossy_bsdf, base: glossy_bsdf_transmission, ior: dispersion?(::base::abbe_number_ior(volume_ior, abbe_number)):color(volume_ior) ) ) ), volume: material_volume( absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness ), ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior));123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::df::*;import ::base::*;import ::math::*;import ::nvidia::core_definitions::apply_colorfalloff;import ::nvidia::core_definitions::thick_glass;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";
/*bsdf apply_colorfalloff_v2( material base = scratched_metal_v2(metal_color: color(1.)), uniform color color_0 = color(1.,0.,0.), uniform color color_1 = color(0.,1.,0.), uniform color color_2 = color(0.,0.,1.), uniform color color_3 = color(1.,0.,0.), uniform color color_4 = color(0.,1.,0.)) = material( surface: material_surface( scattering: df::measured_curve_factor( curve_values: color[](color_0,color_1,color_2,color_3,color_4), base: base.surface.scattering ), emission: base.surface.emission ), volume: base.volume, ior: base.ior, thin_walled: base.thin_walled, geometry: base.geometry);
material gem_definition( color transmission_color = color(1.0), uniform color glass_color = color(.95), float roughness = 0.0, uniform float volume_ior = 1.4f, uniform bool dispersion = true, uniform float abbe_number = 1.4f, uniform float base_thickness = .1, float3 normal = ::state::normal())[[ ::anno::hidden()]] = let{ bsdf glossy_bsdf = ::df::simple_glossy_bsdf( mode: ::df::scatter_reflect, tint: color(1.), roughness_u: roughness ); bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf( mode: ::df::scatter_transmit, tint: transmission_color, roughness_u: roughness ); bsdf surface_bsdf = ::df::weighted_layer( normal: normal, weight: 1., layer: ::df::color_fresnel_layer( layer: glossy_bsdf, base: glossy_bsdf_transmission, ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior) ) ); } in material( thin_walled: false, surface: material_surface(scattering: surface_bsdf ), volume: material_volume( absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness ), ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior));*/
export material Diamond( color transmission_color = color ( 1.f , 1.f , 1.f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 1.f , 1.f , 1.f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform bool dispersion = true [[ ::anno::display_name("Dispersion"), ::anno::description("Enable or disable the dispersion."), ::anno::in_group("Advanced") ]])[[ ::anno::display_name("Diamond"), ::anno::description("Diamond gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Diamond.Diamond.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "transparent", "diamond", "purple"))]] = let{ // Gem definition // uniform color glass_color = color(.95), float roughness = 0.0; float volume_ior = 2.42f; float abbe_number = 55.f; float base_thickness = clarity * 0.1f; // float3 normal = ::state::normal()
bsdf glossy_bsdf = ::df::simple_glossy_bsdf( mode: ::df::scatter_reflect, tint: color(1.), roughness_u: roughness ); bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf( mode: ::df::scatter_transmit, tint: transmission_color, roughness_u: roughness ); bsdf surface_bsdf = ::df::weighted_layer( //normal: normal, // is state::normal anyways, can be omitted weight: 1., layer: ::df::color_fresnel_layer( layer: glossy_bsdf, base: glossy_bsdf_transmission, ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior) ) ); bsdf falloff_bsdf = df::measured_curve_factor( curve_values: color[](color( 0.9529412f , 0.972549f , 1.f), color( 1.f , 0.9529412f , 0.9960784f), color( 0.9529412f , 0.9764706f , 1.f), color( 0.9529412f , 1.f , 0.9960784f), color( 1.f , 0.9529412f , 0.9843137f) ), base: surface_bsdf );
// the apply color falloff function does nothing but add a color gradient while keeping the material'sample // other properties /* ::nvidia::core_definitions::apply_colorfalloff( base: gem_definition( transmission_color: transmission_color, // CHECK glass_color: volume_color, // CHECK was modified in the material+_colume expresion roughness: 0.f, // CHECK volume_ior: 2.42F, // CHECK dispersion: dispersion, // CHECK abbe_number: 55.f, // CHECK base_thickness: clarity * 0.1f, // CHECK normal: ::state::normal ()), // CHECK color_0: color( 0.9529412f , 0.972549f , 1.f), // CHECK color_1: color( 1.f , 0.9529412f , 0.9960784f),// CHECK color_2: color( 0.9529412f , 0.9764706f , 1.f),// CHECK color_3: color( 0.9529412f , 1.f , 0.9960784f),// CHECK color_4: color( 1.f , 0.9529412f , 0.9843137f));// CHECK */ } in material( thin_walled: false, surface: material_surface(scattering: falloff_bsdf ), volume: material_volume( absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(volume_color) / -base_thickness ), ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior));
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::nvidia::core_definitions::thick_glass;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 Emerald( color transmission_color = color(0.456411f, 0.982251f, 0.982251f) // vmat 1.7: ( 0.4627451f , 1.f , 1.f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.01960784f , 0.3176471f , 0.1058824f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]])[[ ::anno::display_name("Emerald"), ::anno::description("Emerald gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Emerald.Emerald.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "emerald", "green"))]]= ::nvidia::core_definitions::thick_glass( transmission_color: transmission_color, glass_color: volume_color, roughness: 0.06f, ior: 1.58f, base_thickness: clarity * 0.015f, normal: ::state::normal ());123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::df::*;import ::math::*;import ::base::*;import ::nvidia::core_definitions::thick_glass;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";
material gem_definition( color transmission_color = color(1.0), uniform color glass_color = color(.95), float roughness = 0.0, uniform float volume_ior = 1.4f, uniform bool dispersion = true, uniform float abbe_number = 1.4f, uniform float base_thickness = .1, float3 normal = ::state::normal())[[ ::anno::hidden()]] = let{
bsdf glossy_bsdf = ::df::simple_glossy_bsdf( mode: ::df::scatter_reflect, tint: color(1.), roughness_u: roughness ); bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf( mode: ::df::scatter_transmit, tint: transmission_color, roughness_u: roughness );} in material( thin_walled: false, surface: material_surface( ::df::weighted_layer( normal: normal, weight: 1., layer: ::df::color_fresnel_layer( layer: glossy_bsdf, base: glossy_bsdf_transmission, ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior) ) ) ), volume: material_volume( absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness ), ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior));
export material Garnet( color transmission_color = color(0.982251f, 0.428690f, 0.116971f) //vmat 1.7: ( 1.f , 0.4392157f , 0.1176471f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.3098039f , 0.003921569f , 0.003921569f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.0f [[ ::anno::display_name("Clarity"), ::anno::description("UUse to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform bool dispersion = true [[ ::anno::display_name("Dispersion"), ::anno::description("Enable or disable the dispersion."), ::anno::in_group("Advanced") ]])[[ ::anno::display_name("Garnet"), ::anno::description("Garnet gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Garnet.Garnet.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "garnet", "red", "warm", "dark"))]]= gem_definition( transmission_color: transmission_color, glass_color: volume_color, roughness: 0.03f, volume_ior: 1.91f, dispersion: dispersion, abbe_number: 52.57f, base_thickness: clarity * 0.01f, normal: ::state::normal ());12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::nvidia::core_definitions::thick_glass;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 Iolite( color transmission_color = color ( 0.6117647f , 0.6117647f , 1.f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.2392157f , 0.172549f , 0.5843138f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]])[[ ::anno::display_name("Iolite"), ::anno::description("Iolite gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Iolite.Iolite.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "iolite", "blue", "cool"))]]= ::nvidia::core_definitions::thick_glass( transmission_color: transmission_color, glass_color: volume_color, roughness: 0.02f, ior: 1.59f, base_thickness: clarity * 0.03f, normal: ::state::normal ());123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::base::texture_return;import ::nvidia::core_definitions::perlin_noise_texture;import ::state::normal;import ::nvidia::core_definitions::thick_translucent;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 material Jade( color transmission_color1 = color ( 0.8352941f , 0.8431373f , 0.6039216f) [[ ::anno::display_name("Transmission Color 1"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], color transmission_color2 = color ( 0.4392157f , 0.6509804f , 0.282353f) [[ ::anno::display_name("Transmission Color 2"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.3488667f , 0.4877647f , 0.3940823f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform float3 texture_translate = float3 ( 0.f) [[ ::anno::display_name("Translate"), ::anno::description("Controls the position of the texture."), ::anno::in_group("Transform") ]], uniform float3 texture_rotate = float3 ( 0.f) [[ ::anno::display_name("Rotate"), ::anno::description("Rotates angle of the texture in degrees."), ::anno::in_group("Transform") ]], uniform float3 texture_scale = float3 ( 1.f) [[ ::anno::display_name("Scale"), ::anno::description("Larger numbers increase the texture size."), ::anno::in_group("Transform"), ::nvidia::core_definitions::dimension(float3(1.0f, 1.0f, 1.0f)) ]])[[ ::anno::display_name("Jade"), ::anno::description("Jade gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Jade.Jade.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "jade", "green"))]]= ::nvidia::core_definitions::thick_translucent( transmission_color: ::nvidia::core_definitions::perlin_noise_texture( color1: transmission_color1, color2: transmission_color2, object_space: true, noise_levels: 3, absolute_noise: true, noise_threshold_high: 0.5f, noise_threshold_low: 0.f, scaling: float3 ( (1.f / texture_scale.x) * 400.f , (1.f / texture_scale.y) * 400.f , (1.f / texture_scale.z) * 380.f), translation: texture_translate , rotation: texture_rotate + float3 ( 0.f, 0.f, 0.f), texture_space: 0).tint, volume_color: volume_color, volume_scattering: 0.98f, roughness: 0.1f, reflectivity: 0.85f, base_thickness: clarity * 0.01f, normal: ::state::normal (), ior: 1.61f);12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::nvidia::core_definitions::thick_glass;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 Morganite( color transmission_color = color(0.982251f, 0.955973f, 0.791298f) // vmat 1.7: ( 1.f , 0.9647059f , 0.8039216f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color(0.982251f, 0.768151f, 0.846873f) // vmat 1.7: ( 1.f , 0.7882353f , 0.8666667f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.0f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]])[[ ::anno::display_name("Morganite"), ::anno::description("Morganite gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Morganite.Morganite.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "morganite", "purple"))]]= ::nvidia::core_definitions::thick_glass( transmission_color: transmission_color, glass_color: volume_color, roughness: 0.003f, ior: 1.595f, base_thickness: clarity * 0.01f, normal: ::state::normal ());123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::base::color_layer_mode;import ::base::texture_return;import ::nvidia::core_definitions::blend_colors;import ::nvidia::core_definitions::checker_texture;import ::nvidia::core_definitions::flow_noise_texture;import ::nvidia::core_definitions::thick_translucent;import ::nvidia::core_definitions::dimension;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 Onyx( color transmission_color = color ( 0.001f , 0.001f , 0.001f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], color striation_color1 = color ( 0.3058824f , 0.3019608f , 0.345098f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], color striation_color2 = color ( 0.1215686f , 0.08235294f , 0.05882353f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform float3 texture_translate = float3 ( 0.f) [[ ::anno::display_name("Translate"), ::anno::description("Controls the position of the texture."), ::anno::in_group("Transform") ]], uniform float3 texture_rotate = float3 ( 0.f) [[ ::anno::display_name("Rotate"), ::anno::description("Rotates angle of the texture in degrees."), ::anno::in_group("Transform") ]], uniform float texture_scale = 1.f [[ ::anno::display_name("Scale"), ::anno::description("Larger numbers increase the texture size."), ::anno::in_group("Transform"), ::nvidia::core_definitions::dimension(float(0.03f)) ]], 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("Onyx"), ::anno::description("Onyx gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Onyx.Onyx.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "onyx", "black", "dark"))]]= ::nvidia::core_definitions::thick_translucent( transmission_color: ::nvidia::core_definitions::blend_colors( color_1: transmission_color, color_2: ::nvidia::core_definitions::flow_noise_texture( color1: striation_color1, color2: striation_color2, object_space: false, texture_space: 0, noise_levels: 3, absolute_noise: false, phase: 0.f, level_gain: 3.f, level_scale: 2.5f, level_progressive_u_scale: 0.f, level_progressive_v_motion: 0.f, scaling: float3 ( 0.f, (1.f / texture_scale) * 7.f, 0.f), translation: texture_translate , rotation: float3 ( texture_rotate.x + 45.f , texture_rotate.y + 90.f , texture_rotate.z + 0.f)).tint, mode: ::base::color_layer_blend, weight: ::nvidia::core_definitions::checker_texture( color1: color ( 0.f , 0.f , 0.f), color2: color ( 1.f , 1.f , 1.f), scaling: float3 ( 0.f , (1.f / texture_scale), 0.f), translation: texture_translate , object_space: false, blur: 0.f, rotation: float3 ( texture_rotate.x + 45.f , texture_rotate.y + 90.f , texture_rotate.z + 0.f), texture_space: uv_space_index).mono).tint, volume_color: color ( 0.95f , 0.95f , 0.95f), volume_scattering: 0.3f, roughness: 0.05f, reflectivity: 1.f, base_thickness: clarity * 0.0001f, normal: ::state::normal (), ior: 1.486f);123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::nvidia::core_definitions::apply_clearcoat;import ::nvidia::core_definitions::apply_colorfalloff;import ::nvidia::core_definitions::blend;import ::nvidia::core_definitions::flex_material;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 Pearl( uniform color diffuse = color ( 0.8509804f , 0.7960784f , 0.7215686f) [[ ::anno::display_name("Color"), ::anno::description("Base color of the pearl."), ::anno::in_group("Appearance") ]])[[ ::anno::display_name("Pearl"), ::anno::description("Pearl gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Pearl.Pearl.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "pearl", "pink", "light"))]]= ::nvidia::core_definitions::apply_clearcoat( base: ::nvidia::core_definitions::blend( base: ::nvidia::core_definitions::flex_material( base_color: diffuse, diffuse_roughness: 0.2f, is_metal: false, reflectivity: 0.7f, reflection_roughness: 0.07f, 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 ()), blend: ::nvidia::core_definitions::apply_colorfalloff( base: ::nvidia::core_definitions::flex_material( base_color: diffuse, diffuse_roughness: 0.2f, is_metal: false, reflectivity: 0.7f, reflection_roughness: 0.07f, 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 ()), color_0: color ( 0.4392157f , 0.3372549f , 0.1411765f), color_1: color ( 0.8039216f , 0.8509804f , 1.f), color_2: color ( 1.f , 0.7294118f , 0.9882353f), color_3: color ( 1.f , 0.5333334f , 0.9568627f), color_4: color ( 1.f , 0.7333333f , 0.1647059f)), weight: 0.6f), ior: 1.6f, roughness: 0.1f, visibility: 1.f, normal: ::state::normal (), coat_filter_color: color ( 1.f , 1.f , 1.f));12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::nvidia::core_definitions::thick_glass;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 Peridot( color transmission_color = color ( 0.9647059f , 1.f , 0.509804f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.5529412f , 0.6862745f , 0.1843137f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]])[[ ::anno::display_name("Peridot"), ::anno::description("Peridot gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Peridot.Peridot.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "peridot", "green"))]]= ::nvidia::core_definitions::thick_glass( transmission_color: transmission_color, glass_color: volume_color, roughness: 0.02f, ior: 1.59f, base_thickness: clarity * 0.01f, normal: ::state::normal ());123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::df::*;import ::base::*;import ::math::*;import ::nvidia::core_definitions::thick_glass;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";
material gem_definition( color transmission_color = color(1.0), uniform color glass_color = color(.95), float roughness = 0.0, uniform float volume_ior = 1.4f, uniform bool dispersion = true, uniform float abbe_number = 1.4f, uniform float base_thickness = .1, float3 normal = ::state::normal())[[ ::anno::hidden()]] = let{ bsdf glossy_bsdf = ::df::simple_glossy_bsdf( mode: ::df::scatter_reflect, tint: color(1.), roughness_u: roughness ); bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf( mode: ::df::scatter_transmit, tint: transmission_color, roughness_u: roughness );} in material( thin_walled: false, surface: material_surface( ::df::weighted_layer( normal: normal, weight: 1., layer: ::df::color_fresnel_layer( layer: glossy_bsdf, base: glossy_bsdf_transmission, ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior) ) ) ), volume: material_volume( absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness ), ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior));
export material Ruby( color transmission_color = color ( 1.f , 0.3294118f , 0.8196079f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.2666667f , 0.007843138f , 0.01568628f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform bool dispersion = true [[ ::anno::display_name("Dispersion"), ::anno::description("Enable or disable the dispersion."), ::anno::in_group("Advanced") ]])[[ ::anno::display_name("Ruby"), ::anno::description("Ruby gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Ruby.Ruby.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "ruby", "red", "warm"))]]= gem_definition( transmission_color: transmission_color, glass_color: volume_color, roughness: 0.06f, volume_ior: 1.78f, dispersion: dispersion, abbe_number: 72.2f, base_thickness: clarity * 0.03f, normal: ::state::normal ());123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::math::*;import ::base::*;import ::df::*;import ::nvidia::core_definitions::flex_material;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";
material gem_definition( color transmission_color = color(1.0), uniform color glass_color = color(.95), float roughness = 0.0, uniform float volume_ior = 1.4f, uniform bool dispersion = true, uniform float abbe_number = 1.4f, uniform float base_thickness = .1, float3 normal = ::state::normal())[[ ::anno::hidden()]] = let{ bsdf glossy_bsdf = ::df::simple_glossy_bsdf( mode: ::df::scatter_reflect, tint: color(1.), roughness_u: roughness ); bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf( mode: ::df::scatter_transmit, tint: transmission_color, roughness_u: roughness );} in material( thin_walled: false, surface: material_surface( ::df::weighted_layer( normal: normal, weight: 1., layer: ::df::color_fresnel_layer( layer: glossy_bsdf, base: glossy_bsdf_transmission, ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior) ) ) ), volume: material_volume( absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness ), ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior));
export material Sapphire( uniform color transmission_color = color ( 0.509804f , 0.427451f , 0.8196079f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.001f , 0.03137255f , 0.2392157f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform bool dispersion = true [[ ::anno::display_name("Dispersion"), ::anno::description("Enable or disable the dispersion."), ::anno::in_group("Advanced") ]])[[ ::anno::display_name("Sapphire"), ::anno::description("Sapphire gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Sapphire.Sapphire.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "sapphire", "blue", "cool", "dark"))]] = gem_definition( transmission_color: transmission_color, glass_color: volume_color, roughness: 0.f, volume_ior: 1.76f, dispersion: dispersion, abbe_number: 72.2f, base_thickness: clarity * 0.1f, normal: ::state::normal ());12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::df::*;import ::base::*;import ::math::*;import ::nvidia::core_definitions::thick_glass;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 Tanzanite( color transmission_color = color ( 0.7215686f , 0.4392157f , 0.8823529f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.01960784f , 0.02745098f , 0.1921569f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]])[[ ::anno::display_name("Tanzanite"), ::anno::description("Tanzanite gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Tanzanite.Tanzanite.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "tanzanite", "purple"))]]= ::nvidia::core_definitions::thick_glass( transmission_color: transmission_color, glass_color: volume_color, roughness: 0.f, ior: 1.7f, base_thickness: clarity * 0.015f, normal: ::state::normal ());123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::df::*;import ::base::*;import ::math::*;import ::nvidia::core_definitions::thick_glass;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";
material gem_definition( color transmission_color = color(1.0), uniform color glass_color = color(.95), float roughness = 0.0, uniform float volume_ior = 1.4f, uniform bool dispersion = true, uniform float abbe_number = 1.4f, uniform float base_thickness = .1, float3 normal = ::state::normal())[[ ::anno::hidden()]] = let{
bsdf glossy_bsdf = ::df::simple_glossy_bsdf( mode: ::df::scatter_reflect, tint: color(1.), roughness_u: roughness ); bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf( mode: ::df::scatter_transmit, tint: transmission_color, roughness_u: roughness );} in material( thin_walled: false, surface: material_surface( ::df::weighted_layer( normal: normal, weight: 1., layer: ::df::color_fresnel_layer( layer: glossy_bsdf, base: glossy_bsdf_transmission, ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior) ) ) ), volume: material_volume( absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness ), ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior));
export material Topaz( color transmission_color = color ( 1.f , 1.f , 1.f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color ( 0.8823529f , 0.6117647f , 0.2117647f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform bool dispersion = true [[ ::anno::display_name("Dispersion"), ::anno::description("Enable or disable the dispersion."), ::anno::in_group("Advanced") ]])[[ ::anno::display_name("Topaz"), ::anno::description("Topaz gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Topaz.Topaz.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "topaz", "purple"))]] = gem_definition( transmission_color: transmission_color, glass_color: volume_color, roughness: 0.f, volume_ior: 1.63f, dispersion: dispersion, abbe_number: 33.54f, base_thickness: clarity * 0.005f, normal: ::state::normal());123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::base::*;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 Tourmaline( uniform color transmission_color1 = color ( .987f , 0.282353f , 0.282353f) [[ ::anno::display_name("Transmission Color 1"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color transmission_color2 = color ( 1.f , 1.f , 1.f) [[ ::anno::display_name("Transmission Color 2"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color transmission_color3 = color ( 0.172549f , 0.427451f , 0.06666667f) [[ ::anno::display_name("Transmission Color 3"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform float3 texture_translate = float3( 0.f) [[ ::anno::display_name("Translate"), ::anno::description("Controls the position of the texture."), ::anno::in_group("Transform") ]], uniform float3 texture_rotate = float3(45.0f, 36.0f, 45.0f) [[ ::anno::display_name("Rotate"), ::anno::description("Rotates angle of the texture in degrees."), ::anno::in_group("Transform") ]], uniform float texture_scale = 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)) ]])[[ ::anno::display_name("Tourmaline"), ::anno::description("Tourmaline gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Tourmaline.Tourmaline.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "tourmaline", "red", "green", "multicolor"))]]= ::nvidia::core_definitions::blend( base: ::nvidia::core_definitions::flex_material( base_color: transmission_color1, diffuse_roughness: 0.f, is_metal: false, reflectivity: 1.f, reflection_roughness: 0.f, anisotropy: 0.f, anisotropy_rotation: 0.f, transparency: 0.7f, transmission_color: transmission_color1, volume_color: transmission_color1, transmission_roughness: 0.05f, base_thickness: clarity * 0.8f, ior: 1.6f, thin_walled: false, normal: ::state::normal ()), blend: ::nvidia::core_definitions::blend( base: ::nvidia::core_definitions::flex_material( base_color: transmission_color2, diffuse_roughness: 0.8f, is_metal: false, reflectivity: 1.f, reflection_roughness: 0.f, anisotropy: 0.f, anisotropy_rotation: 0.f, transparency: 0.6f, transmission_color: transmission_color2, volume_color: transmission_color2, transmission_roughness: 0.01f, base_thickness: clarity * 1.f, ior: 1.6f, thin_walled: false, normal: ::state::normal ()), blend: ::nvidia::core_definitions::thick_glass( transmission_color: transmission_color3, glass_color: transmission_color3, roughness: 0.f, ior: 1.6f, base_thickness: clarity * 0.1f, normal: ::state::normal ()), weight: ::nvidia::core_definitions::flow_noise_texture( color1: color ( 1.f , 1.f , 1.f), color2: color ( 0.f , 0.f , 0.f), object_space: true, texture_space: 0, noise_levels: 2, absolute_noise: false, phase: 0.f, level_gain: 20.f, level_scale: 10.f, level_progressive_u_scale: 1.f, level_progressive_v_motion: 0.f, scaling: float3 ( (10.f / texture_scale) * 5.f , 0.f , 0.f), translation: float3 ( texture_translate .x + 0.095f , texture_translate .y + 0.f , texture_translate .z + 0.f), rotation: float3 ( texture_rotate.x + 0.f , texture_rotate.y + 90.f , texture_rotate.z + 0.f)).mono), weight: ::nvidia::core_definitions::flow_noise_texture( color1: color ( 1.f , 1.f , 1.f), color2: color ( 0.f , 0.f , 0.f), object_space: true, texture_space: 0, noise_levels: 2, absolute_noise: false, phase: 0.f, level_gain: 20.f, level_scale: 10.f, level_progressive_u_scale: 1.f, level_progressive_v_motion: 0.f, scaling: float3 ( (10.f / texture_scale) * 5.f , 0.f , 0.f), translation: float3 ( texture_translate .x + 0.1f , texture_translate .y + 0.f , texture_translate .z + 0.f), rotation: float3 ( texture_rotate.x + 0.f , texture_rotate.y + 90.f , texture_rotate.z + 0.f)).mono);123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719/******************************************************************************<<<<<<< .mine * Copyright 2024 NVIDIA Corporation. All rights reserved. *||||||| .r374748 * Copyright 2023 NVIDIA Corporation. All rights reserved. *======= * Copyright 2024 NVIDIA Corporation. All rights reserved. *>>>>>>> .r376783 ****************************************************************************** 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE 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::*;
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";
enum unit_scale{ unit_mm = 1, unit_cm = 2, unit_m = 3};
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, position * (1.0f - width), // special case of ::math::lerp(0.0, 1.0 - width, position), ::math::lerp(width, 1.0 , position)), 0.0, 1.0);}
struct volume_info{ 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);}
volume_info custom_volume_transmittance( unit_scale unit_scale_select = unit_mm, float absorption_thickness = 3.0f, color transmittance = color(0.5f), 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 rgb2hsl(float3 c)[[ ::anno::description("Converts a color value to HSL. The function outputs the hue to \n" "lie in the range from 0.0-1.0."), ::anno::author("NVIDIA vMaterials")]]{ float3 hsl; float cMax = ::math::max(::math::max(c.x, c.y), c.z); float cMin = ::math::min(::math::min(c.x, c.y), c.z); float delta = cMax - cMin; hsl.z = (cMax + cMin) / 2.0; hsl.x = ((cMax == cMin) ? 0 : (cMax == c.x) ? (c.y - c.z) / delta + ((c.z > c.y) ? 6.0f : 0.0f): (cMax == c.y) ? (c.z - c.x) / delta + 2.0 : (c.x - c.y) / delta + 4.0) / 6.0f; hsl.y = (hsl.z == 0.0 || hsl.z == 1.0) ? 0.0 : delta / (1.0 - ::math::abs(2.0 * hsl.z - 1.0)); return hsl;}
// converts a HSL value back to a color// The Hue is expected to lie in the range float f_n(float n, float a, float h, float l) { float k = ::math::fmod(n + h * 12.f, 12.f); return l - a * ::math::max(-1.0f, ::math::min(::math::min(k-3.0f, 9.0f-k), 1.0f));}
color hsl2rgb(float3 hsl)[[ ::anno::description("Converts a HSL value back to a color. Note that the hue is expected to \n" "lie in the range from 0.0-1.0."), ::anno::author("NVIDIA vMaterials")]]{ float h = hsl.x, s = hsl.y, l = hsl.z; float a = s * ::math::min(l, 1.0f - l); return color(f_n(0.0, a, h, l), f_n(8.0, a, h, l), f_n(4.0, a, h, l)); }
struct vm_coordinates{ float2 uv; // UV coordinates stored as a simple float2 float rotation; // The rotation is stored in radiands (not degress), to convert use ((rotation* 3.1415926535897932384626433832f) / 180.f) int uv_space_index; // The UV space Index from which the UV data came from float4 carry; // may carry additional data, such as random IDs};
struct vm_3float{ float x; float y; float z;};
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_rotate( vm_coordinates uv = vm_coord() [[ ::anno::display_name("VM Coordinates"), ::anno::description("A set of vm coordinates.") ]], float rotation = 0.0f [[ ::anno::display_name("Rotation"), ::anno::description("Rotates the coordinates in degrees.") ]]){ float rot_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; // track rotation float sine = ::math::sin(rot_rad); float cosine = ::math::cos(rot_rad); float2x2 rot = float2x2(cosine, -sine, sine, cosine); uv.rotation += rot_rad; uv.uv = rot * uv.uv; 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 // when set to 'false, tex_b share coordinates from 'uv_a'){ float rot_a = uv_a.rotation; float rot_b = use_coord_a_only ? uv_a.rotation : uv_b.rotation; uv_b.uv = use_coord_a_only ? uv_a.uv : uv_b.uv; // Lookup and convert normal textures a and b to -1 ... 1 range float3 norm_a = (::tex::lookup_float3(tex_a, uv_a.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f; norm_a = ::math::normalize(norm_a * float3(strength_a, strength_a, 1.0)); float3 norm_b = (::tex::lookup_float3(tex_b, uv_b.uv, ::tex::wrap_repeat, ::tex::wrap_repeat) - float3(.5f)) * 2.0f; norm_b = ::math::normalize(norm_b * float3(strength_b, strength_b, 1.0)); // if any rotation happened prior to the lookup, compensate for it norm_a = float3(::math::cos(rot_a) * norm_a.x - ::math::sin(rot_a) * norm_a.y, ::math::sin(rot_a) * norm_a.x + ::math::cos(rot_a) * norm_a.y, norm_a.z); norm_b = float3(::math::cos(rot_b) * norm_b.x - ::math::sin(rot_b) * norm_b.y, ::math::sin(rot_b) * norm_b.x + ::math::cos(rot_b) * norm_b.y, norm_b.z); // http://blog.selfshadow.com/publications/blending-in-detail/ norm_a=norm_a + float3(0.,0.,1.); norm_b = norm_b * float3(-1.,-1.,1.); float3 norm = norm_a*math::dot(norm_a, norm_b)/norm_a.z - norm_b; return norm.x * ::state::texture_tangent_u(uv_a.uv_space_index) + norm.y * ::state::texture_tangent_v(uv_a.uv_space_index) + norm.z * ::state::normal();}
//export material Turquoise( color transmission_color = color (0.296138f, 1.000000f, 0.904661) //( 0.2392157f , 0.8039216f , 0.7294118f) [[ ::anno::display_name("Transmission Color"), ::anno::description("Color effect for transmission independent of thickness of the object."), ::anno::in_group("Appearance") ]], uniform color volume_color = color(0.009721f, 0.693872f, 0.693872f) //( 0.001f , 0.01188235f , 0.01188235f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform color crack_color = color(0.023153f, 0.011612f, 0.001f) // ( 0.02352941f , 0.01176471f , 0.f) [[ ::anno::display_name("Crack Color"), ::anno::description("Color of cracks."), ::anno::in_group("Appearance") ]], uniform color flake_color = color (1.000000f, 0.527115f, 0.001f) //( 1.f , 0.5294118f , 0.f) [[ ::anno::display_name("Flake Color"), ::anno::description("Color of flakes."), ::anno::in_group("Appearance") ]], uniform float clarity = .15f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of object."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform float flake_size = 1.f [[ ::anno::display_name("Flake Size"), ::anno::description("Determines size of flakes (in mm)."), ::anno::in_group("Appearance") ]], uniform float flake_amount = 1.f [[ ::anno::display_name("Flake Amount"), ::anno::description("Determines amount of visible flakes."), ::anno::soft_range(0.0,1.0), ::anno::in_group("Appearance") ]], uniform texture_2d crack_texture = texture_2d ( "./textures/turquoise_crack_msk.png" , ::tex::gamma_srgb) [[ ::anno::display_name("Crack Texture"), ::anno::description("Attach map of cracks here."), ::anno::in_group("Appearance") ]], uniform float3 texture_translate = float3 ( 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 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."), ::anno::in_group("Transform"), ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)) ]], 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("Turquoise"), ::anno::description("Turquoise gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Turquoise.Turquoise.png"), ::anno::hidden(), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "turquoise", "cool"))]]= ::nvidia::core_definitions::add_globalbump( base: ::nvidia::core_definitions::blend( base: ::nvidia::core_definitions::thick_translucent( transmission_color: ::nvidia::core_definitions::perlin_noise_texture( color1: transmission_color, color2: color ( 1.f , 1.f , 1.f), object_space: true, noise_levels: 3, absolute_noise: false, noise_threshold_high: 1.f, noise_threshold_low: 0.f, scaling: float3 ( 300.f , 300.f , 300.f), translation: texture_translate, rotation: float3 (texture_rotate,texture_rotate,texture_rotate), texture_space: uv_space_index).tint, volume_color: volume_color, volume_scattering: 0.99999f, roughness: 0.f, reflectivity: 1.f, base_thickness: clarity * 0.1f, normal: ::state::normal (), ior: 1.65f), blend: ::nvidia::core_definitions::apply_metallicflakes( base: ::nvidia::core_definitions::flex_material( base_color: crack_color, diffuse_roughness: 0.f, is_metal: false, reflectivity: 0.3f, reflection_roughness: 0.2f, 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: clarity * 0.1f, ior: 1.5f, thin_walled: false, normal: ::state::normal ()), flake_color: flake_color, roughness: 0.f, size: flake_size * 0.1f, amount: flake_amount * 0.15f, opacity: 0.5f, bump: 1.f), weight: ::nvidia::core_definitions::file_texture( texture: crack_texture, mono_source: ::base::mono_average, brightness: 1.f, contrast: 1.f, scaling: 1.f / texture_scale, translation: float2 (texture_translate.x, texture_translate.y) , rotation: texture_rotate, clip: false, texture_space: uv_space_index, invert: false).mono), normal: ::nvidia::core_definitions::file_bump_texture( texture: crack_texture, bump_source: ::base::mono_luminance, scaling: 1.f / texture_scale, translation: float2 (texture_translate.x, texture_translate.y) , rotation: texture_rotate, clip: false, factor: -0.2f, texture_space: uv_space_index));
export material Turquoise_Mineral( float turquoise_tint = 1.0f [[ ::anno::description("Adjusts the color of the mineral from greenish to blueish."), ::anno::display_name("Tint"), ::anno::in_group("Appearance"), ::anno::soft_range(0.f, 1.f), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(0) ]], float diffuse_brightness = 0.6f [[ ::anno::description("Adjusts the lightness of the material."), ::anno::display_name("Brightness"), ::anno::in_group("Appearance"), ::anno::soft_range(0.f, 1.f), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(1) ]], float polishing_roughness = 0.26f [[ ::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(2) ]], color veins_color = color(0.158961f, 0.090842f, 0.017642f) [[ ::anno::description("Adjusts the color of the veins."), ::anno::display_name("Vein Color"), ::anno::in_group("Appearance"), ::anno::ui_order(3) ]], float veins_big_amount = 1.f [[ ::anno::description("Controls the visibility of the large veins in the material."), ::anno::display_name("Large Veins"), ::anno::in_group("Appearance"), ::anno::soft_range(0.f, 1.f), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(4) ]], float veins_small_amount = 0.52f [[ ::anno::description("Controls the visibility of the small veins in the material."), ::anno::display_name("Small Veins"), ::anno::in_group("Appearance"), ::anno::soft_range(0.f, 1.f), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(5) ]], float veins_breakup = 0.f [[ ::anno::description("Breaks up the veins, so that they appear and disappear at different positions through the material."), ::anno::display_name("Veins Breakup"), ::anno::in_group("Appearance"), ::anno::soft_range(0.f, 1.f), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(6) ]], float veins_bump_strength = 0.03f [[ ::anno::description("Controls the strength of the veins that appear on the mineral surface."), ::anno::display_name("Veins Bump Strength"), ::anno::in_group("Appearance"), ::anno::soft_range(0.f, 1.f), ::anno::hard_range(0.f, 2.f), ::anno::ui_order(7) ]], float2 texture_translate = float2(0.0f, 0.0f) [[ ::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(0.04f, 0.04f)), ::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.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(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("Turquoise - Sky Blue"), ::anno::description("Turquoise gem material with adjustable color hue and veins."), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Turquoise.Turquoise_Mineral.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "SSS", "transmissive", "new", "design", "turquoise", "blue", "cool", "saturated"))]] = let { bool tmp0 = false; texture_2d multi_rough_tex = texture_2d("./textures/turquoise_multi_rough.jpg", ::tex::gamma_linear); texture_2d veins_tex = texture_2d("./textures/turquoise_veins.jpg", ::tex::gamma_linear); texture_2d breakup_tex = texture_2d("./textures/turquoise_breakup_noise.png", ::tex::gamma_linear); texture_2d diff_lin_tex = texture_2d("./textures/turquoise_diffuse.jpg", ::tex::gamma_linear); texture_2d norm_tex = texture_2d("./textures/turquoise_cracks_norm2.jpg", ::tex::gamma_linear); material_surface tmp1(::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), 0.75f, histogram_scan_small(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, ::base::color_layer_screen, 1.f, true).mono, 0.620000005f, 0.119999997f)), veins_bump_strength) * ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), 0.75f, histogram_scan_small(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, ::base::color_layer_screen, 1.f, true).mono, 0.620000005f, 0.119999997f)), veins_bump_strength), ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), 0.75f, histogram_scan_small(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, ::base::color_layer_screen, 1.f, true).mono, 0.620000005f, 0.119999997f)), veins_bump_strength) * ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), ::math::lerp(histogram_range(vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).x * 0.620000005f + vm_tex_lookup_3float(multi_rough_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float3(1.f)).y, 0.75999999f, polishing_roughness * 0.5f), 0.75f, histogram_scan_small(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, ::base::color_layer_screen, 1.f, true).mono, 0.620000005f, 0.119999997f)), veins_bump_strength), 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.589999974f, ::df::diffuse_reflection_bsdf(::math::pow(nvidia::core_definitions::blend_colors(hsl2rgb(rgb2hsl(float3(vm_tex_lookup(diff_lin_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint)) + float3((turquoise_tint - 1.f) * 0.159999996f, 0.f, 0.f)), veins_color, ::base::color_layer_blend, nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).tint, ::base::color_layer_screen, 1.f, true).mono, true).tint, diffuse_brightness * -2.5999999f + 3.79999995f), 0.f), ::df::weighted_layer(1.f, ::df::diffuse_transmission_bsdf(color(0.768150985f, 0.944563985f, 1.f)), bsdf(), vm_tex_normal_lookup_2x(norm_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), false)), vm_tex_normal_lookup_2x(norm_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), false)), vm_tex_normal_lookup_2x(norm_tex, norm_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(veins_big_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), nvidia::core_definitions::blend_colors(vm_tex_lookup(veins_tex, vm_coord_post_scale(vm_coord_post_rotate(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), 0.74000001f), float2(0.5f)), mono_a, float4(veins_small_amount)).tint, vm_tex_lookup(breakup_tex, vm_coord_post_scale(vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), float2(0.5f)), mono_a, float4(1.f)).tint, ::base::color_layer_multiply, veins_breakup, true).mono * (veins_bump_strength * 10.f), false)), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); color tmp3 = color(1.f, 1.f, 1.f); material_volume tmp4( vdf(), custom_volume_transmittance(unit_cm, 3.f, color(0.0331959985f, 0.0975869969f, 0.0886309966f), hsl2rgb(rgb2hsl(float3(vm_tex_lookup(diff_lin_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint)) + float3((turquoise_tint - 1.f) * 0.159999996f, 0.f, 0.f))).absorption_coefficient, custom_volume_transmittance(unit_cm, 3.f, color(0.0331959985f, 0.0975869969f, 0.0886309966f), hsl2rgb(rgb2hsl(float3(vm_tex_lookup(diff_lin_tex, vm_coord(texture_translate, texture_rotate, texture_scale, uv_space_index), mono_a, float4(1.f)).tint)) + float3((turquoise_tint - 1.f) * 0.159999996f, 0.f, 0.f))).scattering_coefficient, color(0.f, 0.f, 0.f)); material_geometry tmp5(float3(0.f), 1.f, roundcorners_enable ? ::state::rounded_corner_normal(roundcorners_radius_mm * 0.00100000005f, roundcorners_across_materials, 1.f) : ::state::normal()); } in material( thin_walled: tmp0, surface: tmp1, backface: tmp2, ior: tmp3, volume: tmp4, geometry: tmp5);
// 2 export material Turquoise_Blueish_Green(*)[[ ::anno::display_name("Turquoise - Medium Blue"), ::anno::description("Turquoise gem material with adjustable color hue and veins."), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Turquoise.Turquoise_Blueish_Green.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "SSS", "transmissive", "new", "design", "bumped", "turquoise", "medium", "blue", "cool", "saturated"))]] = Turquoise_Mineral( turquoise_tint: 0.66f, diffuse_brightness: 0.6f, polishing_roughness: 0.35f, veins_color: color(0.158961f, 0.090842f, 0.017642f), veins_big_amount: 1.0f, veins_small_amount: 0.81f, veins_breakup: 0.5f, veins_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);
// 3export material Turquoise_Apple_Green(*)[[ ::anno::display_name("Turquoise - Apple Green"), ::anno::description("Turquoise gem material with adjustable color hue and veins."), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Turquoise.Turquoise_Apple_Green.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "SSS", "transmissive", "new", "design", "bumped", "rough", "turquoise", "blue", "apple", "green", "cool", "saturated"))]] = Turquoise_Mineral( turquoise_tint: 0.0f, diffuse_brightness: 0.6f, polishing_roughness: 0.79f, veins_color: color(0.158961f, 0.090842f, 0.017642f), veins_big_amount: 1.0f, veins_small_amount: 0.81f, veins_breakup: 0.5f, veins_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);123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140/****************************************************************************** * 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 distributethe 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 doso, 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 disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, 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 fieldswithin text or binary files as long as those fields can be easily viewed by theuser, 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 acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR 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 USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::df::*;import ::anno::*;import ::base::*;import ::math::*;import ::nvidia::core_definitions::thick_glass;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";
material gem_definition( color transmission_color = color(1.0), uniform color glass_color = color(.95), float roughness = 0.0, uniform float volume_ior = 1.4f, uniform bool dispersion = true, uniform float abbe_number = 1.4f, uniform float base_thickness = .1, float3 normal = ::state::normal())[[ ::anno::hidden()]] = let{ bsdf glossy_bsdf = ::df::simple_glossy_bsdf( mode: ::df::scatter_reflect, tint: color(1.), roughness_u: roughness ); bsdf glossy_bsdf_transmission = ::df::simple_glossy_bsdf( mode: ::df::scatter_transmit, tint: transmission_color, roughness_u: roughness );} in material( thin_walled: false, surface: material_surface( ::df::weighted_layer( normal: normal, weight: 1., layer: ::df::color_fresnel_layer( layer: glossy_bsdf, base: glossy_bsdf_transmission, ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior) ) ) ), volume: material_volume( absorption_coefficient: (base_thickness <= 0)? color(0): ::math::log(glass_color) / -base_thickness ), ior: dispersion?::base::abbe_number_ior(volume_ior, abbe_number):color(volume_ior));
export material Zircon( uniform color volume_color = color ( 0.194618f , 0.879622f , 1.f) [[ ::anno::display_name("Volume Color"), ::anno::description("Color effect for volume of the object reached at transmission distance."), ::anno::in_group("Appearance") ]], uniform float clarity = 1.f [[ ::anno::display_name("Clarity"), ::anno::description("Use to adapt to size of gem, smaller numbers darken the gem."), ::anno::soft_range(0.1,10.0), ::anno::in_group("Appearance") ]], uniform bool dispersion = true [[ ::anno::display_name("Dispersion"), ::anno::description("Enable or disable the dispersion."), ::anno::in_group("Advanced") ]])[[ ::anno::display_name("Zircon"), ::anno::description("Zircon gem material (Default values based on 2cm stone size.)"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Zircon.Zircon.png"), ::anno::key_words(string[]("gem", "jewelry", "gemstone", "transmissive", "new", "design", "zircon", "purple"))]] = gem_definition( transmission_color: color ( 0.5843138f , 0.945098f , 1.f), glass_color: volume_color, roughness: 0.f, volume_ior: 1.92f, dispersion: dispersion, abbe_number: 33.54f, base_thickness: clarity * 0.05f, normal: ::state::normal ());
code/third_party/vMaterials_2/Composite/Carbon_Fiber.mdlAdded+578
code/third_party/vMaterials_2/Composite/Fiberglass.mdlAdded+394
code/third_party/vMaterials_2/Composite/Fiberglass_Imperfections.mdlAdded+878
code/third_party/vMaterials_2/Gems/Alexandrite.mdlAdded+102
code/third_party/vMaterials_2/Gems/Amethyst.mdlAdded+136
code/third_party/vMaterials_2/Gems/Ametrine.mdlAdded+161
code/third_party/vMaterials_2/Gems/Aquamarine.mdlAdded+92
code/third_party/vMaterials_2/Gems/Citrine.mdlAdded+133
code/third_party/vMaterials_2/Gems/Diamond.mdlAdded+235
code/third_party/vMaterials_2/Gems/Emerald.mdlAdded+93
code/third_party/vMaterials_2/Gems/Garnet.mdlAdded+147
code/third_party/vMaterials_2/Gems/Iolite.mdlAdded+91
code/third_party/vMaterials_2/Gems/Jade.mdlAdded+133
code/third_party/vMaterials_2/Gems/Morganite.mdlAdded+91
code/third_party/vMaterials_2/Gems/Onyx.mdlAdded+157
code/third_party/vMaterials_2/Gems/Pearl.mdlAdded+121
code/third_party/vMaterials_2/Gems/Peridot.mdlAdded+91
code/third_party/vMaterials_2/Gems/Ruby.mdlAdded+146
code/third_party/vMaterials_2/Gems/Sapphire.mdlAdded+148
code/third_party/vMaterials_2/Gems/Tanzanite.mdlAdded+94
code/third_party/vMaterials_2/Gems/Topaz.mdlAdded+145
code/third_party/vMaterials_2/Gems/Tourmaline.mdlAdded+181
code/third_party/vMaterials_2/Gems/Turquoise.mdlAdded+719
code/third_party/vMaterials_2/Gems/Zircon.mdlAdded+140
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl.pngAdded
Large File Pointer Details
- SHA256: 30d972b180a2a21d1c2ae146063f8cfc57d6430a6497faa6c0f30339d33b698b
- Pointer size: 130 Bytes
- Size of remote file: 99.5 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper.pngAdded
Large File Pointer Details
- SHA256: 30d972b180a2a21d1c2ae146063f8cfc57d6430a6497faa6c0f30339d33b698b
- Pointer size: 130 Bytes
- Size of remote file: 99.5 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_10_of_12.pngAdded
Large File Pointer Details
- SHA256: be4e5a32d968c59a795af42c28d78e9b61e85099c6a8f3310be94e59e695174d
- Pointer size: 131 Bytes
- Size of remote file: 117 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_11_of_12.pngAdded
Large File Pointer Details
- SHA256: 0b5f5eeed706872228ad5b25f3000b2c39de1f40cb0a75e87b4e50dbabe39431
- Pointer size: 131 Bytes
- Size of remote file: 112 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_2_of_12.pngAdded
Large File Pointer Details
- SHA256: ce960222d6d58dea0f690531ffe7c0d91f8785063cf3b4666605c972a9e55f41
- Pointer size: 131 Bytes
- Size of remote file: 115 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_3_of_12.pngAdded
Large File Pointer Details
- SHA256: 3fd498e2188121e836baae5a3e5f162be5e197235909094af1fd2c3c504fe2b8
- Pointer size: 130 Bytes
- Size of remote file: 95.7 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_4_of_12.pngAdded
Large File Pointer Details
- SHA256: dcfdc644e5378e3bcbf2a43fb55445a5a6af0055f706a28677a14b94c1a4bde2
- Pointer size: 130 Bytes
- Size of remote file: 97.9 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_5_of_12.pngAdded
Large File Pointer Details
- SHA256: 10e1e3095e4783f993a9e974ecb994980bd58dbe0c261f43ec9919fdddecf136
- Pointer size: 130 Bytes
- Size of remote file: 89.2 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_6_of_12.pngAdded
Large File Pointer Details
- SHA256: 980612c9756d62f3072f837ef2359bd4bfbd60139679f3086d766ded70979dc8
- Pointer size: 130 Bytes
- Size of remote file: 83.1 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_7_of_12.pngAdded
Large File Pointer Details
- SHA256: 954d2c3ef9aebed75f4c7e3853eec474d596a9ca2308ad8b472c1d182c15122b
- Pointer size: 131 Bytes
- Size of remote file: 105 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_8_of_12.pngAdded
Large File Pointer Details
- SHA256: 22bba8d5df3e2a396b2a07080266891bf3bc148323ccaf6f31d339df03a06846
- Pointer size: 131 Bytes
- Size of remote file: 104 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aging_Copper.mdl@Aging_Copper_State_9_of_12.pngAdded
Large File Pointer Details
- SHA256: 539e5800a8349896f12923719f3692d2c04d3881b81fac50a475dbf42f687bd2
- Pointer size: 131 Bytes
- Size of remote file: 121 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl.pngAdded
Large File Pointer Details
- SHA256: 3782bb67e830036a1dac35b05760ea01c0ba58836b2ba8b6cb76b1cdc28311e0
- Pointer size: 130 Bytes
- Size of remote file: 77.5 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum.pngAdded
Large File Pointer Details
- SHA256: 3782bb67e830036a1dac35b05760ea01c0ba58836b2ba8b6cb76b1cdc28311e0
- Pointer size: 130 Bytes
- Size of remote file: 77.5 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum_Glossy_Fingerprints.pngAdded
Large File Pointer Details
- SHA256: ba0e2eb9ddabb8c372db142efa6948f75328b8d820a2286279d910f05353a474
- Pointer size: 130 Bytes
- Size of remote file: 82.2 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum.mdl@Aluminum_Polished.pngAdded
Large File Pointer Details
- SHA256: 1dd1f1a3893260657dbb0d9670a5f2b2c78040d0012d606a2088f4a7e204fb4e
- Pointer size: 130 Bytes
- Size of remote file: 75.2 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl.pngAdded
Large File Pointer Details
- SHA256: f6501e6b700f468a3d0d31c8cb49d9794790dfc65291cf02221366230a8729c1
- Pointer size: 130 Bytes
- Size of remote file: 97.6 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized.pngAdded
Large File Pointer Details
- SHA256: f6501e6b700f468a3d0d31c8cb49d9794790dfc65291cf02221366230a8729c1
- Pointer size: 130 Bytes
- Size of remote file: 97.6 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Coated.pngAdded
Large File Pointer Details
- SHA256: 1881a292a4f70b13468fd36939d2f584d311bedd5fa5114b181d7acefb98a53e
- Pointer size: 131 Bytes
- Size of remote file: 102 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Dirty.pngAdded
Large File Pointer Details
- SHA256: 4b18e2deb26076de0e97558f50fe0b2415a4736bdf47d515ab8bfda294f91749
- Pointer size: 131 Bytes
- Size of remote file: 100 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Scratched.pngAdded
Large File Pointer Details
- SHA256: 6921abab02db3df2a443dbe864e0c711810c654f52fb186ba0d5ee52cb5ba7c9
- Pointer size: 130 Bytes
- Size of remote file: 99.3 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Shiny.pngAdded
Large File Pointer Details
- SHA256: 87c9db423944abb798845954f81fda962e221889b65e4f9ee1427617a520c9b4
- Pointer size: 130 Bytes
- Size of remote file: 88.5 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Electric_Blue_Smudges.pngAdded
Large File Pointer Details
- SHA256: c0b0ed489b8a8e66513ef378bfcb20eeb050406366f27b2fd8f96705d577b96e
- Pointer size: 130 Bytes
- Size of remote file: 99.9 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Gold.pngAdded
Large File Pointer Details
- SHA256: b740950d3a8b7538f3e2607073679c2e36886d07d10b6f8d704c7aa7b07ad5ea
- Pointer size: 130 Bytes
- Size of remote file: 90.6 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Grass_Green.pngAdded
Large File Pointer Details
- SHA256: b40d7b24aba83a6a05f3bc3d81c9d6a38748e2c9c9ff08c30420ba2ee0fa4103
- Pointer size: 130 Bytes
- Size of remote file: 88.1 kB
code/third_party/vMaterials_2/Metal/.thumbs/256x256/Aluminum_Anodized.mdl@Aluminum_Anodized_Lavender.pngAdded
Large File Pointer Details
- SHA256: 0c8cba7109e57f14a457a7e3ea94472467dd95de04ca33bf5ed141605f785349
- Pointer size: 130 Bytes
- Size of remote file: 93.7 kB