/***************************************************************************** * Copyright 1986-2020 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. */ /* //fixes: customIOR, AO mapping JIC, added bsdf dropdown //fixes 10/12/2018 - converted metallic Bool into float for map. //jjordan 10/18: disabled bsdf_type. imho makes material complicated without real benefit, but final call is for Daniela since she knows feedback //jjordan 10/18: removed all ternaries on material structs and substituted with ternaries on bsdf. this works around https://moskito.nvidia-arc.com/show_bug.cgi?id=18719 but at the same time is shorter then original code //danielaf 10/24/18: replacing ifm annotation with updated 1.4 anno for parameter ui grouping //danielaf 10/24/18: removing all Booleans and using floats instead for dynamic material in RTX_OV //ddanielaf 10/24/18: adding explicit texture input parameter and texture enable parameters for RTX_OV OMN-812 - unless tex::texture_isvalid implemented in RTX_OV //danielaf 10/24/18: removed anisotropy,backscatter, thinfilms, custom_bsdf, abbe_number(things that don't seem to have any effect in RTX_OV ATM) //danielaf 11/2/2018: omni flex trimmed way down //danielaf 11/06/2018: switch enables to bool! :D //switched back to 1.3, getting "mdl 1.4 not supported" from my iviewer version 2017 1.4 296300.6298 //switched to 1.2 - getting normalmap_texture parameter type error when switching to 1.4 - still troubleshooting //azoellner 1/18/19 - promoting staging to the real material, removed "Staging" from all names //azoellner 2/11/19 modified display name sand group names to match up with known Sol master //rraab 28/2/19 Changed surface reflectance behavior to match the UE4 model //rraab 11/4/19 Changed material name from SolPBR_Master to Advanced PBR, // Adding keywords and removing //tmosier 12/4/19 Cleaned up display names azoellner on behave of Ignacio - 8-9-2019 - added advancedPBR_Cutouts.mdl to improve class comiplation on Kit. azoellner 10/30/19 changing to omniPBR. adding use base texture bool, base color, and so its not required to use emmissive mask. //rraab 2/3/20 Adding clearcloat layer feature to material (IOR based) azoellner 2/4/2020 set default clearcoat to false //rraab 3/9/2020 Metallix material now bumps correctly. Used tint operation for 'directional_factor_bsdf' which is delivers the same result but is simpler. //azoellner 5/6/2020 Updated to import :: //fpliu 5/27/2020 Update to import OmniPBR_ClearCoat_Opacity //fpliu 9/4/2020 Added mono_mode opacity */ mdl 1.4; import ::base::*; import ::anno::*; using XcalibuRPBR_ClearCoat_Opacity import XcalibuRPBR_ClearCoat_Opacity; export material XcalibuRPBR_Opacity( color diffuse_color_constant = color(0.2f) [[ anno::display_name("Base Color"), anno::description("This is the base color"), anno::in_group("Albedo") ]], uniform texture_2d diffuse_texture = texture_2d() [[ anno::display_name("Albedo Map"), anno::in_group("Albedo") ]], float albedo_desaturation = float(0.0) [[ anno::display_name("Albedo Desaturation"), anno::soft_range(float(0.0f), float(1.0f)), anno::description("Desaturates the diffuse color"), anno::in_group("Albedo") ]], float albedo_add = float(0.0) [[ anno::display_name("Albedo Add"), anno::soft_range(float(-1.0f), float(1.0f)), anno::description("Adds a constant value to the diffuse color "), anno::in_group("Albedo") ]], float albedo_brightness = float(1.0) [[ anno::display_name("Albedo Brightness"), anno::soft_range(float(0.0f), float(1.0f)), anno::description("Multiplier for the diffuse color "), anno::in_group("Albedo") ]], color diffuse_tint = color(1.0f) [[ anno::display_name("Color Tint"), anno::description("When enabled, this color value is multiplied over the final albedo color"), anno::in_group("Albedo") ]], // -------------------- REFLECTIVITY ---------------------- float reflection_roughness_constant = 0.5f [[ anno::display_name("Roughness Amount"), anno::hard_range(0.0,1.), anno::description("Higher roughness values lead to more blurry reflections"), anno::in_group("Reflectivity") ]], float reflection_roughness_texture_influence = 0.0f [[ anno::display_name("Roughness Map Influence"), anno::hard_range(0.0, 1.), anno::description("Blends between the constant value and the lookup of the roughness texture"), anno::in_group("Reflectivity") ]], uniform texture_2d reflectionroughness_texture = texture_2d() [[ anno::display_name("Roughness Map"), anno::in_group("Reflectivity") ]], float metallic_constant = 0.f [[ anno::display_name("Metallic Amount"), anno::hard_range(0.0,1.), anno::description("Metallic Material"), anno::in_group("Reflectivity") ]], float metallic_texture_influence = 0.0f [[ anno::display_name("Metallic Map Influence"), anno::hard_range(0.0, 1.), anno::description("Blends between the constant value and the lookup of the metallic texture"), anno::in_group("Reflectivity") ]], uniform texture_2d metallic_texture = texture_2d() [[ anno::display_name("Metallic Map"), anno::in_group("Reflectivity") ]], float specular_level = float(0.5) [[ anno::display_name("Specular"), anno::soft_range(float(0.0f), float(1.0f)), anno::description("The specular level (intensity) of the material"), anno::in_group("Reflectivity") ]], // -------------------- ORM ---------------------- uniform bool enable_ORM_texture = false [[ anno::display_name("Enable ORM Texture"), anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"), anno::in_group("Reflectivity") ]], uniform texture_2d ORM_texture = texture_2d() [[ anno::display_name("ORM Map"), anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"), anno::in_group("Reflectivity") ]], // -------------------- AO Group ---------------------- float ao_to_diffuse = 0.0 [[ anno::display_name("AO to Diffuse"), anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"), anno::in_group("AO") ]], uniform texture_2d ao_texture = texture_2d() [[ anno::display_name("Ambient Occlusion Map"), anno::description("The Ambient Occlusion texture for the material"), anno::in_group("AO") ]], // -------------------- EMISSIVE ---------------------- uniform bool enable_emission = false [[ anno::display_name("Enable Emission"), anno::description("Enables the emission of light from the material"), anno::in_group("Emissive") ]], color emissive_color = color(1.0, 0.1, 0.1) [[ anno::enable_if("enable_emission == true"), anno::display_name("Emissive Color"), anno::description("The emission color"), anno::in_group("Emissive") ]], uniform texture_2d emissive_mask_texture = texture_2d() [[ anno::enable_if("enable_emission == true"), anno::display_name("Emissive Mask map"), anno::description("The texture masking the emissive color"), anno::in_group("Emissive") ]], uniform float emissive_intensity = 40.f [[ anno::enable_if("enable_emission == true"), anno::display_name("Emissive Intensity"), anno::description("Intensity of the emission"), anno::in_group("Emissive") ]], // Opacity Map uniform bool enable_opacity_texture = false [[ anno::display_name("Enable Opacity"), anno::description("Enables or disbales the usage of the opacity texture map"), anno::in_group("Opacity") ]], uniform float opacity_constant = 1.f [[ anno::enable_if("enable_opacity_texture == true"), anno::hard_range(0.0, 1.0), anno::display_name("Opacity Amount"), anno::description("Amount of Opacity"), anno::in_group("Opacity") ]], uniform texture_2d opacity_texture = texture_2d() [[ anno::enable_if("enable_opacity_texture==true"), anno::display_name("Opacity Map"), anno::in_group("Opacity") ]], uniform base::mono_mode opacity_mode = base::mono_average [[ anno::display_name("Opacity Mono Source"), anno::in_group("Opacity"), anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum") ]], // -------------------- Normal ---------------------- /* uniform bool enable_normalmap_texture = false [[ anno::display_name("Enable Normal Texture"), anno::description("Enables the usage of the normalmap texture"), anno::in_group("Features") ]], */ uniform float bump_factor = 1.f [[ anno::display_name("Normal Map Strength"), anno::description("Strength of normal map."), anno::in_group("Normal") ]], uniform texture_2d normalmap_texture = texture_2d() [[ anno::display_name("Normal Map"), anno::description("Enables the usage of the normalmap texture"), anno::in_group("Normal") ]], /* uniform bool enable_detail_normalmap_texture = false [[ anno::display_name("Enable Detail Normal Texture"), anno::in_group("Features"), anno::description("Enables the usage of the detail normalmap texture") ]], */ uniform float detail_bump_factor = .3f [[ anno::display_name("Detail Normal Strength"), anno::in_group("Normal"), anno::description("Strength of the detail normal") ]], uniform texture_2d detail_normalmap_texture = texture_2d() [[ anno::display_name("Detail Normal Map"), anno::in_group("Normal") ]], // UV Projection Group uniform bool project_uvw = false [[ anno::display_name("Enable Project UVW Coordinates"), anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"), anno::in_group("UV") ]], uniform bool world_or_object = false [[ anno::enable_if("project_uvw == true"), anno::display_name("Enable World Space"), anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"), anno::in_group("UV") ]], uniform int uv_space_index = 0 [[ anno::enable_if("project_uvw == true"), anno::display_name("UV Space Index"), anno::description("UV Space Index."), anno::in_group("UV"), anno::hard_range(0, 3) ]], uniform int uv_space_index_detail = 0 [[ anno::enable_if("project_uvw == true"), anno::display_name("UV Space Index Detail"), anno::description("UV Space Index Detail."), anno::in_group("UV"), anno::hard_range(0, 3) ]], // Adjustments Group uniform float2 texture_translate = float2(0.0f) [[ anno::enable_if("project_uvw == true"), anno::display_name("Texture Translate"), anno::description("Controls position of texture."), anno::in_group("UV") ]], uniform float texture_rotate = 0.f [[ anno::enable_if("project_uvw == true"), anno::display_name("Texture Rotate"), anno::description("Rotates angle of texture in degrees."), anno::in_group("UV") ]], uniform float2 texture_scale = float2(1.0f) [[ anno::enable_if("project_uvw == true"), anno::display_name("Texture Scale"), anno::description("Larger number increases size of texture."), anno::in_group("UV") ]], uniform float2 detail_texture_translate = float2(0.0f) [[ anno::enable_if("project_uvw == true"), anno::display_name("Detail Texture Translate"), anno::description("Controls the position of the detail texture."), anno::in_group("UV") ]], uniform float detail_texture_rotate = 0.f [[ anno::enable_if("project_uvw == true"), anno::display_name("Detail Texture Rotate"), anno::description("Rotates angle of the detail texture in degrees."), anno::in_group("UV") ]], uniform float2 detail_texture_scale = float2(1.0f) [[ anno::enable_if("project_uvw == true"), anno::display_name("Detail Texture Scale"), anno::description("Larger numbers increase the size of the detail texture"), anno::in_group("UV") ]] ) [[ anno::display_name("XcalibuRPBR Opacity"), anno::description("XcalibuRPBR supports opacity and ORM textures"), anno::version( 2, 1, 0), anno::author("NVIDIA CORPORATION"), anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) ]] = XcalibuRPBR_ClearCoat_Opacity( diffuse_texture: diffuse_texture, albedo_desaturation: albedo_desaturation, albedo_add: albedo_add, albedo_brightness: albedo_brightness, diffuse_color_constant: diffuse_color_constant, diffuse_tint: diffuse_tint, //ao ao_texture: ao_texture, ao_to_diffuse: ao_to_diffuse, //ORM ORM_texture: ORM_texture, enable_ORM_texture: enable_ORM_texture, //reflectivity reflection_roughness_constant: reflection_roughness_constant, reflectionroughness_texture: reflectionroughness_texture, reflection_roughness_texture_influence: reflection_roughness_texture_influence, metallic_constant: metallic_constant, metallic_texture: metallic_texture, metallic_texture_influence: metallic_texture_influence, specular_level: specular_level, //opacity enable_opacity_texture: enable_opacity_texture, opacity_texture: opacity_texture, opacity_constant: opacity_constant, opacity_mode: opacity_mode, //emissive enable_emission: enable_emission, emissive_color: emissive_color, emissive_mask_texture: emissive_mask_texture, emissive_intensity: emissive_intensity, //clearcoat enable_clearcoat: false, clearcoat_tint: color(1.0f), clearcoat_transparency: 1.0f, clearcoat_reflection_roughness: 0.0f, clearcoat_weight: 1.0f, clearcoat_flatten: 1.0f, clearcoat_ior: 1.56f, clearcoat_bump_factor: 1.f, clearcoat_normalmap_texture: texture_2d(), //normal normalmap_texture: normalmap_texture, bump_factor: bump_factor, detail_normalmap_texture: detail_normalmap_texture, detail_bump_factor: detail_bump_factor, project_uvw: project_uvw, world_or_object: world_or_object, uv_space_index: uv_space_index, uv_space_index_detail: uv_space_index_detail, texture_translate: texture_translate, texture_rotate: texture_rotate, texture_scale: texture_scale, detail_texture_translate: detail_texture_translate, detail_texture_rotate: detail_texture_rotate, detail_texture_scale: detail_texture_scale, clearcoat_texture_translate: float2(0.0f), clearcoat_texture_rotate: 0.0f, clearcoat_texture_scale: float2(1.0f) );