| /****************************************************************************** | |
| * Copyright 2024 NVIDIA Corporation. All rights reserved. * | |
| ****************************************************************************** | |
| Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge, | |
| to any person obtaining a copy of the sample definition code that uses our | |
| Material Definition Language (the "MDL Materials"), to reproduce and distribute | |
| the MDL Materials, including without limitation the rights to use, copy, merge, | |
| publish, distribute, and sell modified and unmodified copies of the MDL | |
| Materials, and to permit persons to whom the MDL Materials is furnished to do | |
| so, in all cases solely for use with NVIDIA's Material Definition Language, | |
| subject to the following further conditions: | |
| 1. The above copyright notices, this list of conditions, and the disclaimer | |
| that follows shall be retained in all copies of one or more of the MDL | |
| Materials, including in any software with which the MDL Materials are bundled, | |
| redistributed, and/or sold, and included either as stand-alone text files, | |
| human-readable headers or in the appropriate machine-readable metadata fields | |
| within text or binary files as long as those fields can be easily viewed by the | |
| user, as applicable. | |
| 2. The name of NVIDIA shall not be used to promote, endorse or advertise any | |
| Modified Version without specific prior written permission, except a) to comply | |
| with the notice requirements otherwise contained herein; or b) to acknowledge | |
| the contribution(s) of NVIDIA. | |
| THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
| OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, | |
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, | |
| TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR | |
| ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, | |
| INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF | |
| CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE | |
| THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS. | |
| */ | |
| mdl 1.6; | |
| import ::anno::*; | |
| import ::base::*; | |
| import ::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); | |