Datasets:

ArXiv:
License:
roboverse_data / materials /vMaterials_2 /Ground /Large_Granite_Paving.mdl
Fisher-Wang's picture
[release] materials
ae81f33
/*****************************************************************************
* Copyright 2024 NVIDIA Corporation. All rights reserved.
******************************************************************************
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
THE MDL MATERIALS.
*/
mdl 1.4;
import ::tex::*;
import ::anno::*;
import ::base::*;
import ::df::*;
import ::math::*;
import ::state::*;
import ::tex::*;
import ::nvidia::core_definitions::dimension;
const string COPYRIGHT =
" Copyright 2024 NVIDIA Corporation. All rights reserved.\n"
" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"
" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"
" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"
" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"
" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"
" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"
" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"
" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"
" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
float remap(float input, float low, float high)
{
return low + input * (high - low);
}
float histogram_range(float input, float range, float position)
{
float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0);
float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0);
return remap(input, low, high);
}
export material Large_Granite_Paving(
float roughness = 0.59f [[
::anno::display_name("Roughness"),
::anno::description("Adjusts the overall roughness of the surface."),
::anno::hard_range(0.f, 1.f),
::anno::in_group("Appearance")
]],
float roughness_variation = 0.46f [[
::anno::display_name("Roughness Variation"),
::anno::description("Low values will result in a more uniform reflection, high value will add more variation."),
::anno::hard_range(0.f, 1.f),
::anno::in_group("Appearance")
]],
uniform float stones_brightness = 0.5f [[
::anno::display_name("Brightness"),
::anno::description("Adjustment to make the material darker/brighter."),
::anno::hard_range(0.f, 1.f),
::anno::in_group("Appearance")
]],
// Adjustments Group
uniform float2 texture_translate = float2(0.f) [[
::anno::display_name("Translate"),
::anno::description("Controls the position of the texture."),
::anno::in_group("Adjustments")
]],
uniform float texture_rotate = 0.f [[
::anno::display_name("Rotate"),
::anno::description("Rotates angle of the texture in degrees."),
::anno::in_group("Adjustments")
]],
uniform float2 texture_scale = float2(1.f) [[
::anno::display_name("Scale"),
::anno::description("Larger numbers increase the size."),
::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)),
::anno::in_group("Adjustments")
]]
)
[[
::anno::author("NVIDIA vMaterials"),
::anno::display_name("Exquisit Paving"),
::anno::description("A paving material of a european boardwalk."),
::anno::key_words(string[]("stone", "pavement", "tile", "paving", "architecture", "new", "gray", "cool")),
::anno::thumbnail("./.thumbs/Large_Granite_Paving.Large_Granite_Paving.png"),
::anno::copyright_notice(COPYRIGHT)
]]
=
let {
bool tmp0 = false;
float2 corrected_scale = 1.0f / texture_scale;
material_surface tmp1(
::df::custom_curve_layer(0.0430000015f, 1.f, 5.f, 1.f, ::df::microfacet_ggx_smith_bsdf(::math::lerp(histogram_range(::base::file_texture(texture_2d("./textures/Large_Granite_Paving_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, ::math::lerp(0.426000029f, 1.f, roughness_variation), ::math::lerp(0.355000019f, 0.66f, roughness)), 0.898000062f, ::base::file_texture(texture_2d("./textures/Large_Granite_Paving_mask.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(histogram_range(::base::file_texture(texture_2d("./textures/Large_Granite_Paving_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, ::math::lerp(0.426000029f, 1.f, roughness_variation), ::math::lerp(0.355000019f, 0.621000051f, roughness)), 0.898000062f, ::base::file_texture(texture_2d("./textures/Large_Granite_Paving_mask.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), ::math::lerp(histogram_range(::base::file_texture(texture_2d("./textures/Large_Granite_Paving_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, ::math::lerp(0.426000029f, 1.f, roughness_variation), ::math::lerp(0.355000019f, 0.621000051f, roughness)), 0.898000062f, ::base::file_texture(texture_2d("./textures/Large_Granite_Paving_mask.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono) * ::math::lerp(histogram_range(::base::file_texture(texture_2d("./textures/Large_Granite_Paving_rough.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono, ::math::lerp(0.426000029f, 1.f, roughness_variation), ::math::lerp(0.355000019f, 0.621000051f, roughness)), 0.898000062f, ::base::file_texture(texture_2d("./textures/Large_Granite_Paving_mask.png", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_average, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).mono), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect, ""), ::df::diffuse_reflection_bsdf(::base::file_texture(texture_2d("./textures/Large_Granite_Paving_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(::math::lerp(0.3f, 0.65200001f, stones_brightness)), ::base::mono_alpha, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint, 0.f, ""), ::state::normal()),
material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance));
color tmp3 = color(1.f, 1.f, 1.f);
material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f));
material_geometry tmp5(
float3(0.f),
1.f,
::base::tangent_space_normal_texture(texture_2d("./textures/Large_Granite_Paving_norm.jpg", ::tex::gamma_linear), 1.f, false, true, ::base::transform_coordinate(::base::rotation_translation_scale(float3(0.f, 0.f, texture_rotate / 180.f * 3.14159274f), float3(texture_translate.x, texture_translate.y, 1.f), float3(corrected_scale.x, corrected_scale.y, 1.f)), ::base::texture_coordinate_info(::state::texture_coordinate(0), ::state::texture_tangent_u(0), ::state::texture_tangent_v(0))), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 1.f, 0.f));
} in
material(
thin_walled: tmp0,
surface: tmp1,
backface: tmp2,
ior: tmp3,
volume: tmp4,
geometry: tmp5);
export material large_granite_paving_shiny(*)
[[
::anno::author("NVIDIA vMaterials"),
::anno::display_name("Exquisit Paving - Shiny"),
::anno::description("A paving material of a european boardwalk with a shiny appearance."),
::anno::key_words(string[]("stone", "pavement", "tile", "paving", "architecture", "construction", "new", "gray", "cool")),
::anno::thumbnail("./.thumbs/Large_Granite_Paving.large_granite_paving_shiny.png"),
::anno::copyright_notice(COPYRIGHT)
]] = Large_Granite_Paving(
roughness: 0.0f,
roughness_variation: 1.0f,
stones_brightness: 0.3f,
texture_translate: float2(0.f, 0.f),
texture_rotate: 0.0f,
texture_scale: float2(1.f, 1.f)
);