diff --git a/assets/scene_usds/ebench/simple_pnp/task1/scene.usda b/assets/scene_usds/ebench/simple_pnp/task1/scene.usda new file mode 100644 index 0000000000000000000000000000000000000000..8509c1a6d712cebbbdcecf66792dfdb1dee99f97 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task1/scene.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_scene" ( + prepend payload = @./scene.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/DayMaterial.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/DayMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2065d8e637cf60ef12e03a73082728622aaa7044 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/DayMaterial.mdl @@ -0,0 +1,67 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material DayMaterial( + float Flat = 1.0 + [[ + anno::display_name("Flat"), + anno::ui_order(32) + ]], + uniform texture_2d img = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("img"), + anno::ui_order(32), + sampler_color() + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + + float3 Normal_mdl = float3(0.0,0.0,1.0); + + float4 Local0 = tex::lookup_float4(img,float2(CustomizedUV0_mdl.x,1.0-CustomizedUV0_mdl.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local1 = (Flat * float3(Local0.x,Local0.y,Local0.z)); + + float3 EmissiveColor_mdl = Local1; + float Opacity_mdl = Local0.w; + float OpacityMask_mdl = (math::saturate(Local0.w) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = float3(0.0,0.0,0.0); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = 0.5; + float2 Refraction_mdl = float2(float2(1.0,0.0).x,float2(1.0,0.0).x); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/KooPbr.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/KooPbr.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5e993afd51fcee2e32fb4d95cd3570aff2eb9405 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/KooPbr.mdl @@ -0,0 +1,462 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::anno::*; +import ::df::*; +import ::df::color_weighted_layer; +import ::math::*; +import ::state::*; + +export material KooMtl2Sided( + material frontMtl = material() [[ + anno::in_group("Parameters"), + anno::display_name("Front material") + ]], + material backMtl = frontMtl [[ + anno::in_group("Parameters"), + anno::display_name("Back material") + ]], + uniform bool use_backMtl = false [[ + anno::in_group("Parameters"), + anno::display_name("Use back material") + ]], + color translucency = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Basic parameters"), + anno::display_name("Translucency") + ]], + color front_tint = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Front tint"), + anno::hidden() + ]], + color back_tint = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Back tint"), + anno::hidden() + ]], + uniform bool multiply_by_front_diffuse = false [[ + anno::in_group("Basic parameters"), + anno::display_name("Multiply by front diffuse"), + anno::unused(), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + bsdf transmission_bsdf = + df::diffuse_transmission_bsdf(tint: (front_tint + back_tint)*0.5f); + + bsdf front_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : frontMtl.surface.scattering + ); + + bsdf back_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : backMtl.surface.scattering + ); + } in + material( + thin_walled: true, + ior: frontMtl.ior, + surface: material_surface(scattering: front_bsdf), + backface: material_surface(scattering: use_backMtl ? back_bsdf : front_bsdf), + volume: frontMtl.volume, + geometry: frontMtl.geometry + ); + +float emissive_multiplier() uniform +[[ + anno::description("unit conversion from pbrjson emission to mdl"), + anno::noinline() +]] +{ + return 2560.f; +} + +export material KooLightMtl( + color emission = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Emission") + ]], + uniform float emission_mult = 1.f [[ + anno::in_group("Parameters"), + anno::display_name("Mutliplier") + ]], + color opacity = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Opacity") + ]], + uniform bool emit_on_backside = false [[ + anno::in_group("Parameters"), + anno::display_name("Emit light on back side") + ]]) +[[ + anno::author("KooLab") +]] + = + let { + color emission_color = (emission*opacity)*emission_mult * emissive_multiplier(); + + bsdf surface_bsdf = + df::simple_glossy_bsdf + ( + mode: df::scatter_transmit, + tint: color(1.f) - opacity, + roughness_u: 0 + ); + + material_surface emit_surface = material_surface( + scattering: surface_bsdf, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: emission_color) + ); + } in + material( + thin_walled: emit_on_backside, + ior: color(1.f), + surface: emit_surface, + backface: emit_on_backside ? emit_surface : material_surface() + ); + +export material KooMtl( + color diffuse = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("diffuse") + ]], + color reflect = color(0.f, 0.f, 0.f) [[ + anno::in_group("Reflections"), + anno::display_name("reflect") + ]], + float reflect_glossiness = 1.f [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool fresnel = true [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float fresnel_ior = 1.6f [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::hard_range(0.2f, 5.f) + ]], + uniform bool fresnel_ior_lock = true [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refract_ior = 1.6f [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool invert_refraction_ior = false [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + color self_illumination = color(0.f, 0.f, 0.f) [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-Illumination Intensity") + ]], + float anisotropy = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + float3 texmap_bump = state::normal() [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float opacity = 1.f [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + uniform bool thin_walled = false [[ + anno::in_group("Options"), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + float reflection_roughness = math::pow((1.f - reflect_glossiness), 2.f); + + float refl_ior = invert_reflection_ior ? 1.f/(fresnel_ior + 0.01f) : fresnel_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refract_ior + 0.01f) : refract_ior; + + float ior = fresnel_ior_lock ? refr_ior : refl_ior; + float R0 = math::pow((1.f - ior)/(1.f + ior), 2.f); + + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse, + roughness : 0.0f + ), + normal : texmap_bump + ); + + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: fresnel ? reflect : color(1.f), + roughness_u: reflection_roughness + ); + + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: diffuse, + roughness_u: reflection_roughness + ); + + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : fresnel ? color(R0) : reflect, + grazing_reflectivity: fresnel ? color(1.f) : reflect, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ); + } in + material + ( + ior : color(refr_ior), + thin_walled : thin_walled, + surface : material_surface + ( + scattering : surface_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry + ( + cutout_opacity: opacity + ) + ); + +export material KooTranslucentMtl( + color diffuse = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("Diffuse") + ]], + color reflect = color(0.f, 0.f, 0.f) [[ + anno::in_group("Reflections"), + anno::display_name("Reflect") + ]], + float reflect_glossiness = 1.f [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool fresnel = true [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float fresnel_ior = 1.6f [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::soft_range(0.2, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool fresnel_ior_lock = true [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + color refract = color(0.f, 0.f, 0.f) [[ + anno::in_group("Refractions"), + anno::display_name("Refract") + ]], + float refract_glossiness = 1.f [[ + anno::in_group("Refractions"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refract_ior = 1.6f [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool invert_refraction_ior = false [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + color self_illumination = color(0.f, 0.f, 0.f) [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f [[ + anno::in_group("Self-Illumination"), + anno::display_name("Multiplier") + ]], + float anisotropy = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + float3 texmap_bump = state::normal() [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float texmap_opacity = 1.f [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + uniform bool thin_walled = false [[ + anno::in_group("Options"), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + float reflection_roughness = math::pow((1.f - reflect_glossiness), 2.f); + + float refraction_roughness = math::pow((1.f - refract_glossiness), 2.f); + + float refl_ior = invert_reflection_ior ? 1.f/(fresnel_ior + 0.01f) : fresnel_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refract_ior + 0.01f) : refract_ior; + + float ior = fresnel_ior_lock ? refr_ior : refl_ior; + float R0 = math::pow((1.f - ior)/(1.f + ior), 2.f); + + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse, + roughness : 0.f + ), + normal : texmap_bump + ); + + bsdf glossy_transmission_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: color(1.f), + roughness_u: refraction_roughness + ); + + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: fresnel ? reflect : color(1.f), + roughness_u: reflection_roughness + ); + + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: diffuse, + roughness_u: reflection_roughness + ); + + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : fresnel ? color(R0) : reflect, + grazing_reflectivity: fresnel ? color(1.f) : reflect, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : + df::color_weighted_layer + ( + weight : refract, + layer : glossy_transmission_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ), + normal : texmap_bump + ); + } in + material( + thin_walled : thin_walled, + ior : color(refr_ior), + surface : material_surface + ( + scattering : surface_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry(cutout_opacity: texmap_opacity) + ); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0333071a0001d129d2.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0333071a0001d129d2.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bd8630566bbf2e5be4765ab08407df47e40f85ba --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0333071a0001d129d2.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd0333071a0001d129d2(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,14,998],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.003899999894f, 0.003899999894f, 0.003899999894f), + reflect: color(0.5490000248f, 0.5490000248f, 0.5490000248f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0340eb7c0001b6b6f1.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0340eb7c0001b6b6f1.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b10b01f1d040cbdde719d87e1663abf76246548c --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0340eb7c0001b6b6f1.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd0340eb7c0001b6b6f1(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,998],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.05999999866f, 0.05999999866f, 0.05999999866f), + reflect_glossiness: 0.8500000238f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0355f6830001519201.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0355f6830001519201.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9d7457a779d7497cc9f9e298af1c8fb0d6fe97c4 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0355f6830001519201.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd0355f6830001519201(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,998],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.007799999788f, 0.007799999788f, 0.007799999788f), + reflect: color(0.05900000036f, 0.05900000036f, 0.05900000036f), + reflect_glossiness: 0.8000000119f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0390c49f0001be062f.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0390c49f0001be062f.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fd787b2cf0d1865c691e12af1367e35360e25c8d --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0390c49f0001be062f.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd0390c49f0001be062f(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.007799999788f, 0.007799999788f, 0.007799999788f), + reflect: color(0.3490000069f, 0.3490000069f, 0.3490000069f), + reflect_glossiness: 0.8999999762f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd039a6c3200011b1ed4.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd039a6c3200011b1ed4.mdl new file mode 100644 index 0000000000000000000000000000000000000000..20bb9c4d87e904b136c8ff806f5f556bb22bac3f --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd039a6c3200011b1ed4.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd039a6c3200011b1ed4(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,14,998],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.90200001f, 0.1176000014f, 0.1176000014f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd03d6f2be0001bb3123.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd03d6f2be0001bb3123.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2def1508b5f2b324409314890e54d28f684ef2f6 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd03d6f2be0001bb3123.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd03d6f2be0001bb3123(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,998],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.1960999966f, 0.1960999966f, 0.1960999966f), + reflect: color(0.3370000124f, 0.3370000124f, 0.3370000124f), + reflect_glossiness: 0.8000000119f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0a9b93930001101b50.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0a9b93930001101b50.mdl new file mode 100644 index 0000000000000000000000000000000000000000..898ceb20ef7dfaec05517d9743b0c221c689ad10 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0a9b93930001101b50.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_bitmap_bump; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6576cd0a9b93930001101b50(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,14,29],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.0234999992f, 0.01180000044f, 0.003899999894f), + reflect: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/aebff12d803ce3c0bbb82c9437bad79cb9478d5_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/092884d75a7babfa5109ff5c3c0305fab0b4393_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::KooPbr_bitmap_bump(1, true, false, true, false, 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, 1.f, 0, texture_2d("../textures/abf8871c7e904d8a5201ae05340bd4a0751386e2_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, 0.05000000075f, 1.f, false, false, false, 1.f, 1.f, 0.f), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0aa38875000154215f.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0aa38875000154215f.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1d9883453ca8b4c7143c98ecbcf3ce6a521391fa --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0aa38875000154215f.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6576cd0aa38875000154215f(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,14],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/456840f936217fbba9e70a2ff1c55f0732361aa_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.5189999938f, 0.5189999938f, 0.5189999938f), + reflect_glossiness: 0.6510000229f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0aade22a0001b5738c.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0aade22a0001b5738c.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b8e62bfe2041187305d2351a61e15f33c35feefa --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0aade22a0001b5738c.mdl @@ -0,0 +1,39 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_bitmap_bump; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6576cd0aade22a0001b5738c(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,30,34],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/447d3d919861734770fd5f3aa1af7ee8ed644e3_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(0.0270000007f, 0.0270000007f, 0.0270000007f), + refract_glossiness: 1.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::KooPbr_bitmap_bump(1, true, false, true, false, 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, 1.f, 0, texture_2d("../textures/7897e88a9f66fb10b322124850f938cc3880d06_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, 0.3000000119f, 1.f, false, false, false, 1.f, 1.f, 0.f), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0ade958f0001607c83.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0ade958f0001607c83.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6ce700332bf7c1b6d801cf5dfc6975afdbd220d0 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd0ade958f0001607c83.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_bitmap_bump; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6576cd0ade958f0001607c83(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,14,28,29],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/8311160a7625ef2eea1e447a57a89871aa2155d5_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 0.4799999893f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::KooPbr_bitmap_bump(1, true, false, true, false, 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, 1.f, 0, texture_2d("../textures/85fa678e3d52324f860466e642b8dfe284202449_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, 0.1000000015f, 1.f, false, false, false, 1.f, 1.f, 0.f), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd810a5e870001ce4cdf.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd810a5e870001ce4cdf.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0373466e259ef55f02bfd9ec62f8b6d1d5655fe5 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd810a5e870001ce4cdf.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd810a5e870001ce4cdf(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.007799999788f, 0.007799999788f, 0.007799999788f), + reflect: color(0.5f, 0.2899999917f, 0.150000006f), + reflect_glossiness: 0.8500000238f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd814a62b000011cfc2f.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd814a62b000011cfc2f.mdl new file mode 100644 index 0000000000000000000000000000000000000000..90fc7c9f11aa545487c8b743feab56d09af5e24e --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6576cd814a62b000011cfc2f.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd814a62b000011cfc2f(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,14,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.431400001f, 0.400000006f, 0.380400002f), + reflect: color(0.5370000005f, 0.5370000005f, 0.5370000005f), + reflect_glossiness: 0.8399999738f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e70a5e870001ce5d81.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e70a5e870001ce5d81.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a89f94e1d78696b552eb92f031981237afbdc5df --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e70a5e870001ce5d81.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657755e70a5e870001ce5d81(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,32,998],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.1000000015f, 0.1000000015f, 0.1000000015f), + reflect_glossiness: 0.6000000238f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e790c49f0001be1714.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e790c49f0001be1714.mdl new file mode 100644 index 0000000000000000000000000000000000000000..df6466a556d4ffe7294e059cc698e28239faf6db --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e790c49f0001be1714.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657755e790c49f0001be1714(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,32,998],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.9685999751f, 0.9685999751f, 0.9685999751f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e79b93930001102c32.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e79b93930001102c32.mdl new file mode 100644 index 0000000000000000000000000000000000000000..257805ac62e56cedc448f045cda00fec4c3f89f0 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e79b93930001102c32.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::anno::description; + +export material MI_657755e79b93930001102c32(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,998],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(1.f, 1.f, 1.f), + reflect: color(0.09000000358f, 0.09000000358f, 0.09000000358f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(1.f, 1.f, 1.f), + refract_glossiness: 1.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e7de958f0001608d2f.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e7de958f0001608d2f.mdl new file mode 100644 index 0000000000000000000000000000000000000000..457a78bea48cdc2a01172a82d3b404d5b04142f3 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e7de958f0001608d2f.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657755e7de958f0001608d2f(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,32,998],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.9804000258f, 0.9804000258f, 0.9804000258f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e7e876a400018c9b74.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e7e876a400018c9b74.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e427c70ae423367a08c0f9f762770c010e3bcc68 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657755e7e876a400018c9b74.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657755e7e876a400018c9b74(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,30,34,998],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.3799999952f, 0.3799999952f, 0.3799999952f), + reflect_glossiness: 0.8999999762f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d0a5e870001ce8062.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d0a5e870001ce8062.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9d10f8077c7f46253fceb02bca0d0e40aa35e303 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d0a5e870001ce8062.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6578264d0a5e870001ce8062(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.200000003f, 0.200000003f, 0.200000003f), + reflect: color(0.8309999704f, 0.8309999704f, 0.8309999704f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 5.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d10a93f0001437451.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d10a93f0001437451.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0957279d46db1f5ba0da56a3ad667c1873a560cc --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d10a93f0001437451.mdl @@ -0,0 +1,38 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6578264d10a93f0001437451(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,32,10],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/519a1d41d066efef49241dd252dab6093a7a20_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/5d1ca697c41548fb95c59ea0fa7ec93dab6e22_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/0eafe69bdab06643b4c08cad35acb82bc06e39_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: true, + fresnel_ior: 2.075000048f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/ef68bff7c3033487501b7b2b67ee326e847eaf_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + refract_glossiness: 1.f, + refract_ior: 2.069000006f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d40eb7c0001b6e9a2.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d40eb7c0001b6e9a2.mdl new file mode 100644 index 0000000000000000000000000000000000000000..aae6f61b5c3a2a47c1e0258072bfb266e877271a --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d40eb7c0001b6e9a2.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6578264d40eb7c0001b6e9a2(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/73678ef383d2cd81fe6bc1d5e7c5c27790af4c_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.824000001f, 0.824000001f, 0.824000001f), + reflect_glossiness: 0.8000000119f, + fresnel: true, + fresnel_ior: 1.519999981f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d9b93930001104ed2.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d9b93930001104ed2.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4ccc9589aca8eed75fb89592ab15f9fbd0540a06 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264d9b93930001104ed2.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6578264d9b93930001104ed2(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.01180000044f, 0.01180000044f, 0.01180000044f), + reflect: color(0.5730000138f, 0.5730000138f, 0.5730000138f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 2.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264dd6f2be0001bb6464.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264dd6f2be0001bb6464.mdl new file mode 100644 index 0000000000000000000000000000000000000000..91b6a74f5da1a41ab2d8906d0be6fae5b029ed6e --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264dd6f2be0001bb6464.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_bitmap_bump; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6578264dd6f2be0001bb6464(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/082e53ddb8b3d00de04a222779e602bcb7b11f_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/111f86ca16c890352ede05812fe9913962ad34_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect_glossiness: 0.75f, + fresnel: true, + fresnel_ior: 5.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::KooPbr_bitmap_bump(1, true, false, true, false, 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, 1.f, 0, texture_2d("../textures/087b24c40339d0274dbf445f676c6642b1f65f_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, 0.01999999955f, 1.f, false, false, false, 1.f, 1.f, 0.f), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264e17d81a00010c29f4.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264e17d81a00010c29f4.mdl new file mode 100644 index 0000000000000000000000000000000000000000..daa2aa82bb3e420f9ae293e05b22d96b97904725 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264e17d81a00010c29f4.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6578264e17d81a00010c29f4(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.01180000044f, 0.01180000044f, 0.01180000044f), + reflect: color(0.4589999914f, 0.4589999914f, 0.4589999914f), + reflect_glossiness: 0.8999999762f, + fresnel: true, + fresnel_ior: 1.519999981f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264ea9943b0001cacb88.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264ea9943b0001cacb88.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bb92dfddd3fddebdd36634d064dfbbfe608049f9 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264ea9943b0001cacb88.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_bitmap_bump; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6578264ea9943b0001cacb88(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 3.f, 0.f, 5.f, 1.f, true, false, true, false, 0.f, 0.f, 57.29578018f, 0, texture_2d("../textures/fa095f99bb270b22a1133a4cd4f485955a1bc84_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: KooPbr_maps::KooPbr_bitmap(1, 3.f, -1.f, 5.f, 3.f, true, false, true, false, 0.f, 0.f, 57.29578018f, 0, texture_2d("../textures/56652044f450966373a2c5a21e7db070ed1475c_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect_glossiness: 0.8000000119f, + fresnel: true, + fresnel_ior: 5.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: -0.5f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::KooPbr_bitmap_bump(1, true, false, true, false, 0.f, 0.f, 57.29578018f, 3.f, 0.f, 5.f, 1.f, 0, texture_2d("../textures/fa095f99bb270b22a1133a4cd4f485955a1bc84_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, 0.01999999955f, 1.f, false, false, false, 1.f, 1.f, 0.f), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264ee876a400018cbe47.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264ee876a400018cbe47.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fcf7bd822021ee422b7aff490796b42423beed21 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578264ee876a400018cbe47.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::anno::description; + +export material MI_6578264ee876a400018cbe47(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,10,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(0.2705999911f, 0.2705999911f, 0.2705999911f), + reflect: color(0.8080000281f, 0.8080000281f, 0.8080000281f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.519999981f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(1.f, 1.f, 1.f), + refract_glossiness: 1.f, + refract_ior: 1.5f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826510a5e870001ce8065.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826510a5e870001ce8065.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6accca445cf3f39289fea36bbcc8f5a21981d3e6 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826510a5e870001ce8065.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657826510a5e870001ce8065(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.8431000113f, 0.8431000113f, 0.8431000113f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265110a93f0001437455.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265110a93f0001437455.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8a83768a9606987d0c3ebf3814ede682a0d214a4 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265110a93f0001437455.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6578265110a93f0001437455(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/353bbd53207167fd1fe2cb964e7c67fa091a08_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.349999994f, 0.349999994f, 0.349999994f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 3.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 1.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265117d81a00010c29f6.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265117d81a00010c29f6.mdl new file mode 100644 index 0000000000000000000000000000000000000000..82d4e36835c5aafdf6053318353004a17cc01a20 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265117d81a00010c29f6.mdl @@ -0,0 +1,17 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooLightMtl; +import ::anno::description; + +export material MI_6578265117d81a00010c29f6(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.4.1\"}") +]] + = KooPbr::KooLightMtl( + emission: color(1.f, 1.f, 1.f), + emission_mult: 4.f, + opacity: color(1.f, 1.f, 1.f), + emit_on_backside: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265140eb7c0001b6e9a5.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265140eb7c0001b6e9a5.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1f4a371295357a5a716a710cdd94e68d41e025b8 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265140eb7c0001b6e9a5.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6578265140eb7c0001b6e9a5(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.01180000044f, 0.01180000044f, 0.01180000044f), + reflect: color(0.25f, 0.2899999917f, 0.3100000024f), + reflect_glossiness: 0.9599999785f, + fresnel: true, + fresnel_ior: 2.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: KooPbr_maps::KooPbr_bitmap(1, -0.5f, -0.5f, 2.f, 2.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/6b72f36092caeeedd8746d1826e83751ea2fa0b_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826514c99360001dbf404.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826514c99360001dbf404.mdl new file mode 100644 index 0000000000000000000000000000000000000000..68a57b95feaa00bfd26ca277717ae942fd2afd27 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826514c99360001dbf404.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_falloff; +import ::anno::description; +import ::base::texture_return; + +export material MI_657826514c99360001dbf404(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_falloff(base::texture_return(tint: color(0.f, 0.f, 0.f), mono: 1.f), base::texture_return(tint: color(0.09019999951f, 0.09019999951f, 0.09019999951f), mono: 1.f)).tint, + reflect: color(0.349999994f, 0.349999994f, 0.349999994f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 3.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 1.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826515d54100001e32c6f.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826515d54100001e32c6f.mdl new file mode 100644 index 0000000000000000000000000000000000000000..512dfc876baceff57e33f6da7dcf4c1d7ce35065 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826515d54100001e32c6f.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657826515d54100001e32c6f(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.349999994f, 0.349999994f, 0.349999994f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 3.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 1.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265190c49f0001be398d.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265190c49f0001be398d.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a73998561b9faf94ecd51baa876f996e592a3849 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265190c49f0001be398d.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6578265190c49f0001be398d(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.2353000045f, 0.2353000045f, 0.2353000045f), + reflect: color(0.4199999869f, 0.4199999869f, 0.4199999869f), + reflect_glossiness: 0.6000000238f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826519b93930001104ed6.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826519b93930001104ed6.mdl new file mode 100644 index 0000000000000000000000000000000000000000..71fcecfc333b82e2407b0b53dc9f7eff2f62d9ba --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826519b93930001104ed6.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_falloff; +import ::anno::description; +import ::base::texture_return; + +export material MI_657826519b93930001104ed6(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_falloff(base::texture_return(tint: color(0.1647000015f, 0.1647000015f, 0.1647000015f), mono: 1.f), base::texture_return(tint: color(0.3019999862f, 0.3019999862f, 0.3019999862f), mono: 1.f)).tint, + reflect: color(0.349999994f, 0.349999994f, 0.349999994f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 3.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 1.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782651a3887500015454bd.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782651a3887500015454bd.mdl new file mode 100644 index 0000000000000000000000000000000000000000..77b0b4e9be4098890f66c72722b69bcd71e28e25 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782651a3887500015454bd.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_65782651a3887500015454bd(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.349999994f, 0.349999994f, 0.349999994f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 3.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 1.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782651d6f2be0001bb6469.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782651d6f2be0001bb6469.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fab457d65b3fe1b11c3851bffb13928f6377f2e8 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782651d6f2be0001bb6469.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_falloff; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_65782651d6f2be0001bb6469(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,30,29,34],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_falloff(base::texture_return(tint: color(0.05490000173f, 0.06270000339f, 0.08630000055f), mono: 1.f), base::texture_return(tint: color(0.01569999941f, 0.01960000023f, 0.0234999992f), mono: 1.f)).tint, + reflect: KooPbr_maps::KooPbr_bitmap(1, -1.f, -1.75f, 3.f, 4.5f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/e525cc8ebf274005d8ff7ed3b9cde07753e4190_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect_glossiness: 0.6800000072f, + fresnel: true, + fresnel_ior: 5.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 1.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782651e876a400018cbe49.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782651e876a400018cbe49.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2287c420db292aa63fee6040f13e819ef18adc16 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782651e876a400018cbe49.mdl @@ -0,0 +1,38 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_65782651e876a400018cbe49(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,10,28,12],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(0.003899999894f, 0.003899999894f, 0.003899999894f), + reflect: color(0.6549999714f, 0.6549999714f, 0.6549999714f), + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 0.1000000015f, 0.1000000015f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/ed2d6b446af54888dc0e7be8897937e61216533d_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(0.9449999928f, 0.9449999928f, 0.9449999928f), + refract_glossiness: 0.6000000238f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826530a5e870001ce8068.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826530a5e870001ce8068.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8df8f9765cd31e4703dd6f2c59b48d48f43b46ba --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826530a5e870001ce8068.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::KooPbr_maps::NormalMap_bump; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_657826530a5e870001ce8068(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,14,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.4269999862f, 0.4269999862f, 0.4269999862f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 5.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::NormalMap_bump(KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/6599bad98af8ac2ab5b46611d5fa240e32277_1.jpg", ::tex::gamma_linear), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f), state::normal(), 1.f, 1.f, false, false, false, 1, 0.f, 0.1000000015f), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265310a93f0001437459.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265310a93f0001437459.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d7bb4aecb64baaa6b67f013998606f84642af0e2 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265310a93f0001437459.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6578265310a93f0001437459(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(1.f, 1.f, 1.f), + reflect: color(0.9100000262f, 0.9100000262f, 0.9100000262f), + reflect_glossiness: 0.9300000072f, + fresnel: true, + fresnel_ior: 2.200000048f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265311bd150001eb41e4.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265311bd150001eb41e4.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cf8e9fb6e945850cb9c23c6bceee321816cea935 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265311bd150001eb41e4.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6578265311bd150001eb41e4(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,29],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.9157999754f, 0.9157999754f, 0.9157999754f), + reflect: color(0.8000000119f, 0.8000000119f, 0.8000000119f), + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, -0.5f, -0.5f, 2.f, 2.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/e82bdbe7a68f210f8ac3394dc7fc788ea5225a45_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265317d81a00010c29f9.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265317d81a00010c29f9.mdl new file mode 100644 index 0000000000000000000000000000000000000000..94b79bf678e8a1017e660aa4e108c701ec198b5a --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265317d81a00010c29f9.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_falloff; +import ::anno::description; +import ::base::texture_return; + +export material MI_6578265317d81a00010c29f9(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.8549000025f, 0.858799994f, 0.90200001f), + reflect: KooPbr_maps::KooPbr_falloff(base::texture_return(tint: color(0.f, 0.f, 0.f), mono: 1.f), base::texture_return(tint: color(1.f, 1.f, 1.f), mono: 1.f)).tint, + reflect_glossiness: 0.6499999762f, + fresnel: false, + fresnel_ior: 1.460000038f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826534a62b000011d2f14.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826534a62b000011d2f14.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c50e6102760eb068dc4f0897e7654ec17a6beb42 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826534a62b000011d2f14.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657826534a62b000011d2f14(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.8899999857f, 0.8899999857f, 0.8899999857f), + reflect_glossiness: 0.8999999762f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826534c99360001dbf408.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826534c99360001dbf408.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2ca00efb23c7e3be56fc3eec0da91c62fb08f0f7 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826534c99360001dbf408.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657826534c99360001dbf408(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.03920000046f, 0.03920000046f, 0.03920000046f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265355f683000151c5ab.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265355f683000151c5ab.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b3cce3840aa135f856a1bf741fe95fbe8b609abf --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265355f683000151c5ab.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6578265355f683000151c5ab(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.5f, 0.5f, 0.5f), + reflect: color(0.1449999958f, 0.1449999958f, 0.1449999958f), + reflect_glossiness: 0.8000000119f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826535d54100001e32c72.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826535d54100001e32c72.mdl new file mode 100644 index 0000000000000000000000000000000000000000..63aff61e93c576a4fed3c7675612f66d61d4dc9b --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826535d54100001e32c72.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657826535d54100001e32c72(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.3411999941f, 0.3411999941f, 0.3411999941f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 0.5f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265390c49f0001be398f.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265390c49f0001be398f.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fbd8a6718a16d46574df6623a3e8a9c9a34da445 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578265390c49f0001be398f.mdl @@ -0,0 +1,38 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6578265390c49f0001be398f(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,32,10,29],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/ccc1800449a63968b5d771d92774a323c6135d0_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/d6944d2712b5e3a42e5f0c6a7f282bc2ab6ec7d_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/19833074011603dd7b754f5ed2c328be049ceec_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/8bb7197833f7495a896ea81b6f0e6d664315db2_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + refract_glossiness: 1.f, + refract_ior: 1.518000007f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826539a6c3200011b5256.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826539a6c3200011b5256.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e288791633aa33b9f03f78551777ddcb3fc47050 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657826539a6c3200011b5256.mdl @@ -0,0 +1,38 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_657826539a6c3200011b5256(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,10,29],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(0.9412000179f, 0.9412000179f, 0.9412000179f), + reflect: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/b7cfaf675af5a3af4d217c717061233cf076268_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/41af32e96baf29240ee1cecaaf09c5a9e19d02a_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(0.9800000191f, 0.9800000191f, 0.9800000191f), + refract_glossiness: 1.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653a3887500015454c0.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653a3887500015454c0.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a8f7bbf0c155c448c4649269d5c7668b6a13a1b8 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653a3887500015454c0.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_65782653a3887500015454c0(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,29],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.8709999919f, 0.8709999919f, 0.8709999919f), + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/d35eb859bf7818ec39b700b4f4788d2bd85bf08_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653a9943b0001cacb8f.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653a9943b0001cacb8f.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3bd6e6a185e6fd44bf3226da6cbab50178e646d5 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653a9943b0001cacb8f.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_65782653a9943b0001cacb8f(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.8863000274f, 0.8863000274f, 0.8863000274f), + reflect: color(0.8000000119f, 0.8000000119f, 0.8000000119f), + reflect_glossiness: 0.9499999881f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653ade22a0001b5a6fc.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653ade22a0001b5a6fc.mdl new file mode 100644 index 0000000000000000000000000000000000000000..330630badc3cc3e9a3c5a685a763dc5aa41b5082 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653ade22a0001b5a6fc.mdl @@ -0,0 +1,38 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_65782653ade22a0001b5a6fc(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,32,10,29],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/72bb79d56a4ccb771410c73d92c3308af115bb5_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/12d1c3ace7f55796ccefcd4401567345ab72213_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/365c4d6fb113dbe3779b5f6d303ff05c659e47e_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/ac7f8d7ce21c3b0a190f8f8c7ec413259f1957e_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + refract_glossiness: 1.f, + refract_ior: 1.51699996f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653d6f2be0001bb646c.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653d6f2be0001bb646c.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9b19bd77e212108e67bbbe8f72699347df5df6e8 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653d6f2be0001bb646c.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_bitmap_bump; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_65782653d6f2be0001bb646c(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,29],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.9157999754f, 0.9157999754f, 0.9157999754f), + reflect: color(0.8884999752f, 0.8884999752f, 0.8884999752f), + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/87f67610da78f601410e818f96c0ffa5e774d5b_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: true, + fresnel_ior: 2.200000048f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::KooPbr_bitmap_bump(1, true, false, true, false, 0.f, 0.f, 0.f, 0.25f, 0.25f, 0.5f, 0.5f, 0, texture_2d("../textures/0e48bb40eb8e366928dca1739f743f3c94e0321_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, 0.200000003f, 1.f, false, false, false, 1.f, 1.f, 0.f), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653e876a400018cbe4c.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653e876a400018cbe4c.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fcca7e66d0843128da02194a1a2c7a3ec6ccf3d6 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65782653e876a400018cbe4c.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_65782653e876a400018cbe4c(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(1.f, 1.f, 1.f), + reflect: color(0.1650000066f, 0.1650000066f, 0.1650000066f), + reflect_glossiness: 0.8799999952f, + fresnel: true, + fresnel_ior: 2.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895460a5e870001ce8d3e.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895460a5e870001ce8d3e.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4581254fb900e6bf03565af10ea4824895b9dd8f --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895460a5e870001ce8d3e.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657895460a5e870001ce8d3e(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(1.f, 1.f, 1.f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954610a93f0001438150.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954610a93f0001438150.mdl new file mode 100644 index 0000000000000000000000000000000000000000..12da65f26f5aafa6fd0efec2eca2e564b6f06280 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954610a93f0001438150.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6578954610a93f0001438150(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.06669999659f, 0.06669999659f, 0.06669999659f), + reflect: color(0.3409999907f, 0.3409999907f, 0.3409999907f), + reflect_glossiness: 0.9499999881f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954617d81a00010c3723.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954617d81a00010c3723.mdl new file mode 100644 index 0000000000000000000000000000000000000000..eea4b61fc4756577e87c02d0d7a972bc854b5c8c --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954617d81a00010c3723.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_falloff; +import ::anno::description; +import ::base::texture_return; + +export material MI_6578954617d81a00010c3723(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.4275000095f, 0.4471000135f, 0.4745000005f), + reflect: KooPbr_maps::KooPbr_falloff(base::texture_return(tint: color(0.f, 0.f, 0.f), mono: 1.f), base::texture_return(tint: color(0.1140000001f, 0.1140000001f, 0.1140000001f), mono: 1.f)).tint, + reflect_glossiness: 0.8000000119f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954633071a0001d169e3.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954633071a0001d169e3.mdl new file mode 100644 index 0000000000000000000000000000000000000000..376819421aaee75cd2719655067cf7fe2069f83f --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954633071a0001d169e3.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6578954633071a0001d169e3(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.4471000135f, 0.470600009f, 0.4862999916f), + reflect: color(0.92900002f, 0.9330000281f, 0.9369999766f), + reflect_glossiness: 0.9499999881f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 0.200000003f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954640eb7c0001b6f68c.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954640eb7c0001b6f68c.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e4bcd2150667be045d9fa1bcbf9c0f8947eac692 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954640eb7c0001b6f68c.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6578954640eb7c0001b6f68c(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(1.f, 1.f, 1.f), + reflect_glossiness: 0.9499999881f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 0.200000003f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954655f683000151d298.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954655f683000151d298.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fcaa0cc9a6378132936de46dd0d1d3e44300f5aa --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_6578954655f683000151d298.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6578954655f683000151d298(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.3490000069f, 0.3490000069f, 0.3490000069f), + reflect: color(0.8939999938f, 0.8939999938f, 0.8939999938f), + reflect_glossiness: 0.9599999785f, + fresnel: true, + fresnel_ior: 3.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895465d54100001e3395a.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895465d54100001e3395a.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d45bae2bb1db5428875ccc08fbe771d97fd949f1 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895465d54100001e3395a.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657895465d54100001e3395a(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.6313999891f, 0.6313999891f, 0.6313999891f), + reflect: color(0.6819999814f, 0.6819999814f, 0.6819999814f), + reflect_glossiness: 0.9499999881f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895469a6c3200011b5f65.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895469a6c3200011b5f65.mdl new file mode 100644 index 0000000000000000000000000000000000000000..41655e3a847d85151d7c8052b047713bd20bea86 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895469a6c3200011b5f65.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657895469a6c3200011b5f65(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.02749999985f, 0.02749999985f, 0.02749999985f), + reflect: color(1.f, 1.f, 1.f), + reflect_glossiness: 0.9900000095f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895469b93930001105bb8.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895469b93930001105bb8.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fe4789a7da219995aa21bd2ad8e34bb426201e5c --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_657895469b93930001105bb8.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_657895469b93930001105bb8(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.1098000035f, 0.1098000035f, 0.1098000035f), + reflect: color(0.2430000007f, 0.2430000007f, 0.2430000007f), + reflect_glossiness: 0.9499999881f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65789546a9943b0001cad856.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65789546a9943b0001cad856.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6d599b1574fe72197faa0fa80eccf818d4137360 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65789546a9943b0001cad856.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_65789546a9943b0001cad856(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.01960000023f, 0.01960000023f, 0.01960000023f), + reflect: color(0.08600000292f, 0.08600000292f, 0.08600000292f), + reflect_glossiness: 0.9499999881f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.440000057f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65789546d6f2be0001bb7175.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65789546d6f2be0001bb7175.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a6908b4ab828e5ece7d29f0fa5752a607bbe7350 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65789546d6f2be0001bb7175.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_65789546d6f2be0001bb7175(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65789546e876a400018ccb32.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65789546e876a400018ccb32.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f88b1dbaef36d02113b106cc18475fb0950f31d4 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/MI_65789546e876a400018ccb32.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::anno::description; + +export material MI_65789546e876a400018ccb32(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,999],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(0.06669999659f, 0.06669999659f, 0.06669999659f), + reflect: color(0.125f, 0.125f, 0.125f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(0.8820000291f, 0.8820000291f, 0.8820000291f), + refract_glossiness: 1.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/Num558291a3e4b00692e7af15f0.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/Num558291a3e4b00692e7af15f0.mdl new file mode 100644 index 0000000000000000000000000000000000000000..80331e5ce8834c9f044f6786b7c0ac3a27bb6570 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/Num558291a3e4b00692e7af15f0.mdl @@ -0,0 +1,307 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num558291a3e4b00692e7af15f0( + uniform texture_2d Normal_Tex = texture_2d("../textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float Opacity = 0.5 + [[ + anno::display_name("Opacity"), + anno::ui_order(32), + anno::in_group("Translucent") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + uniform float SwitchRefraction = 0.0 + [[ + anno::display_name("SwitchRefraction"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + uniform float FresnelB = 1.517 + [[ + anno::display_name("FresnelB"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + float Local89 = ((math::abs(SwitchRefraction - 1.0) > 0.01) ? (1.0) : FresnelB); + + float3 EmissiveColor_mdl = Local28; + float Opacity_mdl = Opacity; + float OpacityMask_mdl = (math::saturate(Opacity) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + float2 Refraction_mdl = float2(Local89,Local89); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/Num5dae68165b89690001619877.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/Num5dae68165b89690001619877.mdl new file mode 100644 index 0000000000000000000000000000000000000000..eb2dfb76e766ef819c8cd099d4baf592840c67e5 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/Num5dae68165b89690001619877.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5dae68165b89690001619877( + uniform texture_2d Normal_Tex = texture_2d("../textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/Num60db2086e399d00001dee92d.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/Num60db2086e399d00001dee92d.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4d6c9a71d30ecb5abc64e97e3cd87259ff6af0b9 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/Num60db2086e399d00001dee92d.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num60db2086e399d00001dee92d( + uniform texture_2d Normal_Tex = texture_2d("../textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/OmniUe4Base.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/OmniUe4Base.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a441fbaf28040302c7aaabfbcf14b24a85bdf643 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/OmniUe4Base.mdl @@ -0,0 +1,224 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - merge unlit template +//* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side +//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - /* flip_tangent_v */ + tangent_v * normal.y + + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Base( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + float clearcoat_weight = 0.0, + float clearcoat_roughness = 0.0, + float3 clearcoat_normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform bool is_tangent_space_normal = true, + uniform bool two_sided = false, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Base"), + anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::saturate(metallic); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_clearcoat_weight = math::saturate(clearcoat_weight); + float final_clearcoat_roughness = math::saturate(clearcoat_roughness); + float3 final_normal = math::normalize(normal); + float3 final_clearcoat_normal = math::normalize(clearcoat_normal); + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color), + normal: the_normal); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + // clearcoat layer + float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0); + float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness; + + float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ); + + + bsdf clearcoat = + df::custom_curve_layer( + base: df::weighted_layer( + layer: dielectric_metal_mix, + weight: 1.0, + normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal + ), + layer: df::microfacet_ggx_smith_bsdf( + roughness_u: clearcoat_alpha, + tint: color(1.0) + ), + normal_reflectivity: 0.04, + grazing_reflectivity: clearcoat_grazing_refl, + normal: the_clearcoat_normal, + weight: final_clearcoat_weight + ); + bsdf surface = is_unlit ? bsdf() : clearcoat; +} +in material( + thin_walled: two_sided, // Graphene? + surface: material_surface( + scattering: surface, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + backface: material_surface( + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + geometry: material_geometry( + displacement: displacement, + normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(), + cutout_opacity: enable_opacity ? opacity : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/OmniUe4Function.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/OmniUe4Function.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0801afff6f0870ea2574c9e9b6e2043e79e9a79 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/OmniUe4Function.mdl @@ -0,0 +1,1413 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.1 - using absolute import paths when importing standard modules + +mdl 1.6; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + + +export float3 convert_to_left_hand(float3 vec3, uniform bool up_z = true, uniform bool is_position = true) +[[ + anno::description("convert from RH to LH"), + anno::noinline() +]] +{ + float4x4 ZupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4x4 YupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4 vec4 = float4(vec3.x, vec3.y, vec3.z, is_position ? 1.0f : 0.0f); + + vec4 = vec4 * (up_z ? ZupConversion : YupConversion); + + return float3(vec4.x, vec4.y, vec4.z); +} + +export float3 transform_vector_from_tangent_to_world(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from tangent space to world space"), + anno::noinline() +]] +{ + /* flip_tangent_v */ + return convert_to_left_hand( + tangent_u * vector.x - tangent_v * vector.y + state::normal() * vector.z, + up_z, false); +} + +export float3 transform_vector_from_world_to_tangent(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from world space to tangent space"), + anno::noinline() +]] +{ + float3 vecRH = convert_to_left_hand(vector, up_z, false); + /* flip_tangent_v */ + return vecRH.x * float3(tangent_u.x, -tangent_v.x, state::normal().x) + + vecRH.y * float3(tangent_u.y, -tangent_v.y, state::normal().y) + + vecRH.z * float3(tangent_u.z, -tangent_v.z, state::normal().z); +} + +export float4 unpack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Unpack a normal stored in a normal map"), + anno::noinline() +]] +{ + float2 normal_xy = float2(texture_sample.x, texture_sample.y); + + normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0); + float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) ); + return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 ); +} + +// for get color value from normal. +export float4 pack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Pack to color from a normal") +]] +{ + float2 return_xy = float2(texture_sample.x, texture_sample.y); + + return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0); + + return float4( return_xy.x, return_xy.y, 0.0, 1.0 ); +} + +export float4 greyscale_texture_lookup( + float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0) + ) +[[ + anno::description("Sampling a greyscale texture"), + anno::noinline() +]] +{ + return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x); +} + +export float3 pixel_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Pixel normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 vertex_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Vertex normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 landscape_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Landscape normal in world space") +]] +{ + float3 normalFromNormalmap = math::floor((::vertex_normal_world_space(up_z) * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0; + + float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y); + return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY)))); +} + +// Different implementation specific between mdl and hlsl for smoothstep +export float smoothstep(float a, float b, float l) +{ + if (a < b) + { + return math::smoothstep(a, b, l); + } + else if (a > b) + { + return 1.0 - math::smoothstep(b, a, l); + } + else + { + return l <= a ? 0.0 : 1.0; + } +} + +export float2 smoothstep(float2 a, float2 b, float2 l) +{ + return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y)); +} + +export float3 smoothstep(float3 a, float3 b, float3 l) +{ + return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z)); +} + +export float4 smoothstep(float4 a, float4 b, float4 l) +{ + return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w)); +} + +export float2 smoothstep(float2 a, float2 b, float l) +{ + return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l)); +} + +export float3 smoothstep(float3 a, float3 b, float l) +{ + return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l)); +} + +export float4 smoothstep(float4 a, float4 b, float l) +{ + return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l)); +} + +export float2 smoothstep(float a, float b, float2 l) +{ + return float2(smoothstep(a, b, l.x), smoothstep(a, b, l.y)); +} + +export float3 smoothstep(float a, float b, float3 l) +{ + return float3(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z)); +} + +export float4 smoothstep(float a, float b, float4 l) +{ + return float4(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z), smoothstep(a, b, l.w)); +} + +//------------------ Random from UE4 ----------------------- +float length2(float3 v) +{ + return math::dot(v, v); +} + +float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v) +{ + const float2 ZShear = float2(17.0f, 89.0f); + + float2 OffsetA = v.z * ZShear; + float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f; + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat); + return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0; +} + +float3 SkewSimplex(float3 In) +{ + return In + math::dot(In, float3(1.0 / 3.0f) ); +} +float3 UnSkewSimplex(float3 In) +{ + return In - math::dot(In, float3(1.0 / 6.0f) ); +} + +// 3D random number generator inspired by PCGs (permuted congruential generator) +// Using a **simple** Feistel cipher in place of the usual xor shift permutation step +// @param v = 3D integer coordinate +// @return three elements w/ 16 random bits each (0-0xffff). +// ~8 ALU operations for result.x (7 mad, 1 >>) +// ~10 ALU operations for result.xy (8 mad, 2 >>) +// ~12 ALU operations for result.xyz (9 mad, 3 >>) + +//TODO: uint3 +int3 Rand3DPCG16(int3 p) +{ + // taking a signed int then reinterpreting as unsigned gives good behavior for negatives + //TODO: uint3 + int3 v = int3(p); + + // Linear congruential step. These LCG constants are from Numerical Recipies + // For additional #'s, PCG would do multiple LCG steps and scramble each on output + // So v here is the RNG state + v = v * 1664525 + 1013904223; + + // PCG uses xorshift for the final shuffle, but it is expensive (and cheap + // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps + // + // Feistel ciphers divide the state into separate parts (usually by bits) + // then apply a series of permutation steps one part at a time. The permutations + // use a reversible operation (usually ^) to part being updated with the result of + // a permutation function on the other parts and the key. + // + // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for + // the combination function, and just multiplying the other two parts (no key) for + // the permutation function. + // + // That gives a simple mad per round. + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + + // only top 16 bits are well shuffled + return v >> 16; +} + +// Wraps noise for tiling texture creation +// @param v = unwrapped texture parameter +// @param bTiling = true to tile, false to not tile +// @param RepeatSize = number of units before repeating +// @return either original or wrapped coord +float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize) +{ + return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v; +} + +// Evaluate polynomial to get smooth transitions for Perlin noise +// only needed by Perlin functions in this file +// scalar(per component): 2 add, 5 mul +float4 PerlinRamp(float4 t) +{ + return t * t * t * (t * (t * 6 - 15) + 10); +} + +// Blum-Blum-Shub-inspired pseudo random number generator +// http://www.umbc.edu/~olano/papers/mNoise.pdf +// real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes +// instead, we use a single prime M just small enough not to overflow +// note that the above paper used 61, which fits in a half, but is unusably bad +// @param Integer valued floating point seed +// @return random number in range [0,1) +// ~8 ALU operations (5 *, 3 frac) +float RandBBSfloat(float seed) +{ + float BBS_PRIME24 = 4093.0; + float s = math::frac(seed / BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + return s; +} + +// Modified noise gradient term +// @param seed - random seed for integer lattice position +// @param offset - [-1,1] offset of evaluation point from lattice point +// @return gradient direction (xyz) and contribution (w) from this lattice point +float4 MGradient(int seed, float3 offset) +{ + //TODO uint + int rand = Rand3DPCG16(int3(seed,0,0)).x; + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000); + float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1; + return float4(direction.x, direction.y, direction.z, math::dot(direction, offset)); +} + +// compute Perlin and related noise corner seed values +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = true to return seed values for a repeating noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @param seed000-seed111 = hash function seeds for the eight corners +// @return fractional part of v +struct SeedValue +{ + float3 fv = float3(0); + float seed000 = 0; + float seed001 = 0; + float seed010 = 0; + float seed011 = 0; + float seed100 = 0; + float seed101 = 0; + float seed110 = 0; + float seed111 = 0; +}; + +SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds; + seeds.fv = math::frac(v); + float3 iv = math::floor(v); + + const float3 primes = float3(19, 47, 101); + + if (bTiling) + { // can't algebraically combine with primes + seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize)); + seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize)); + seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize)); + seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize)); + seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize)); + seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize)); + seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize)); + seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize)); + } + else + { // get to combine offsets with multiplication by primes in this case + seeds.seed000 = math::dot(iv, primes); + seeds.seed100 = seeds.seed000 + primes.x; + seeds.seed010 = seeds.seed000 + primes.y; + seeds.seed110 = seeds.seed100 + primes.y; + seeds.seed001 = seeds.seed000 + primes.z; + seeds.seed101 = seeds.seed100 + primes.z; + seeds.seed011 = seeds.seed010 + primes.z; + seeds.seed111 = seeds.seed110 + primes.z; + } + + return seeds; +} + +struct SimplexWeights +{ + float4 Result = float4(0); + float3 PosA = float3(0); + float3 PosB = float3(0); + float3 PosC = float3(0); + float3 PosD = float3(0); +}; + +// Computed weights and sample positions for simplex interpolation +// @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d +SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos) +{ + SimplexWeights weights; + float3 OrthogonalPosFloor = math::floor(OrthogonalPos); + + weights.PosA = OrthogonalPosFloor; + weights.PosB = weights.PosA + float3(1, 1, 1); + + OrthogonalPos -= OrthogonalPosFloor; + + float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z)); + float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z)); + + weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z); + weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z); + + float RG = OrthogonalPos.x - OrthogonalPos.y; + float RB = OrthogonalPos.x - OrthogonalPos.z; + float GB = OrthogonalPos.y - OrthogonalPos.z; + + weights.Result.z = + math::min(math::max(0, RG), math::max(0, RB)) // X + + math::min(math::max(0, -RG), math::max(0, GB)) // Y + + math::min(math::max(0, -RB), math::max(0, -GB)); // Z + + weights.Result.w = + math::min(math::max(0, -RG), math::max(0, -RB)) // X + + math::min(math::max(0, RG), math::max(0, -GB)) // Y + + math::min(math::max(0, RB), math::max(0, GB)); // Z + + weights.Result.y = Smallest; + weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w; + + return weights; +} + +// filtered 3D gradient simple noise (few texture lookups, high quality) +// @param v >0 +// @return random number in the range -1 .. 1 +float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos) +{ + float3 OrthogonalPos = SkewSimplex(EvalPos); + + SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos); + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit) + float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA); + float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB); + float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC); + float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD); + + Weights.PosA = UnSkewSimplex(Weights.PosA); + Weights.PosB = UnSkewSimplex(Weights.PosB); + Weights.PosC = UnSkewSimplex(Weights.PosC); + Weights.PosD = UnSkewSimplex(Weights.PosD); + + float DistanceWeight; + + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight; + + return 32 * (a + b + c + d); +} + +// filtered 3D noise, can be optimized +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize) +{ + bTiling = true; + float3 fv = math::frac(v); + float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize); + float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize); + + const int2 ZShear = int2(17, 89); + + float2 OffsetA = iv0.z * ZShear; + float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset + if (bTiling) // tiling, have to compute from wrapped coordinates + { + OffsetB = iv1.z * ZShear; + } + + // Texture size scale factor + float ts = 1 / 128.0f; + + // texture coordinates for iv0.xy, as offset for both z slices + float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts; + float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts; + + // texture coordinates for iv1.xy, as offset for both z slices + float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates + float2 TexB1 = TexB0 + ts; + if (bTiling) // for tiling, need to compute from wrapped coordinates + { + TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts; + TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts; + } + + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit) + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 A = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 B = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 C = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 D = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 E = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 F = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 G = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 H = PerlinNoiseColor * 2 - 1; + + float a = math::dot(A, fv - float3(0, 0, 0)); + float b = math::dot(B, fv - float3(1, 0, 0)); + float c = math::dot(C, fv - float3(0, 1, 0)); + float d = math::dot(D, fv - float3(1, 1, 0)); + float e = math::dot(E, fv - float3(0, 0, 1)); + float f = math::dot(F, fv - float3(1, 0, 1)); + float g = math::dot(G, fv - float3(0, 1, 1)); + float h = math::dot(H, fv - float3(1, 1, 1)); + + float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0))); + + float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y); + float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y); + + return math::lerp(i, j, Weights.z); +} + +// @return random number in the range -1 .. 1 +// scalar: 6 frac, 31 mul/mad, 15 add, +float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz) +{ + // needs to be the same value when creating the PerlinNoise3D texture + float Extent = 16; + + // last texel replicated and needed for filtering + // scalar: 3 frac, 6 mul + xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1); + + // scalar: 3 frac + float3 uvw = math::frac(xyz); + // = floor(xyz); + // scalar: 3 add + float3 p0 = xyz - uvw; +// float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping) + // scalar: 2*3 add 5*3 mul + float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0)); + float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping + // scalar: 3 add + float3 p = p0 + f; + // scalar: 3 mad + // TODO: need reverse??? + float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset + + // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count) + // scalar: 4 mad, 3 mul, 3 add + float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f; + float d = NoiseSample.w * 255.f - 127; + return math::dot(xyz, n) - d; +} + +// Perlin-style "Modified Noise" +// http://www.umbc.edu/~olano/papers/index.html#mNoise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w; + float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w; + float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w; + float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w; + float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w; + float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w; + float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w; + float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D value noise - used to be incorrectly called Perlin noise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1; + float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1; + float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1; + float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1; + float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1; + float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1; + float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1; + float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D jitter offset within a voronoi noise cell +// @param pos - integer lattice corner +// @return random offsets vector +float3 VoronoiCornerSample(float3 pos, int Quality) +{ + // random values in [-0.5, 0.5] + float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5; + + // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 2x2x2 search + if (Quality <= 2) + { + return math::normalize(noise) * 0.2588; + } + + // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 3x3x3 search + if (Quality == 3) + { + return math::normalize(noise) * 0.3090; + } + + // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search + return noise; +} + +// compare previous best with a new candidate +// not producing point locations makes it easier for compiler to eliminate calculations when they're not needed +// @param minval = location and distance of best candidate seed point before the new one +// @param candidate = candidate seed point +// @param offset = 3D offset to new candidate seed point +// @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position +// @return position (if bDistanceOnly is false) and distance to closest seed point so far +float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly) +{ + if (bDistanceOnly) + { + return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset))); + } + else + { + float newdist = math::dot(offset, offset); + return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist); + } +} + +// 220 instruction Worley noise +float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly) +{ + float3 fv = math::frac(v), fv2 = math::frac(v + 0.5); + float3 iv = math::floor(v), iv2 = math::floor(v + 0.5); + + // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away + float4 mindist = float4(0,0,0,100); + float3 p, offset; + + // quality level 3: do a 3x3x3 search + if (Quality == 3) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 1; ++offset_x) + { + for (offset_y = -1; offset_y <= 1; ++offset_y) + { + for (offset_z = -1; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + + // everybody else searches a base 2x2x2 neighborhood + else + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = 0; offset_x <= 1; ++offset_x) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // quality level 2, do extra set of points, offset by half a cell + if (Quality == 2) + { + // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + } + + // quality level 4: add extra sets of four cells in each direction + if (Quality >= 4) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 2; offset_x += 3) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + // along x axis + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along y axis + p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along z axis + p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + } + } + } + } + + // transform squared distance to real distance + return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w)); +} + +// Coordinates for corners of a Simplex tetrahedron +// Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011 +// @param v = 3D noise argument +// @return 4 corner locations +float4x3 SimplexCorners(float3 v) +{ + // find base corner by skewing to tetrahedral space and back + float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3); + float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6; + float3 f = v - base; + + // Find offsets to other corners (McEwan did this in tetrahedral space, + // but since skew is along x=y=z axis, this works in Euclidean space too.) + float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y); + float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0; + + // four corners + return float4x3(base, base + a1, base + a2, base + 0.5); +} + +// Improved smoothing function for simplex noise +// @param f = fractional distance to four tetrahedral corners +// @return weight for each corner +float4 SimplexSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale))); +} + +// Derivative of simplex noise smoothing function +// @param f = fractional distanc eto four tetrahedral corners +// @return derivative of smoothing function for each corner by x, y and z +float3x4 SimplexDSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + s = -12 * scale + s*(24 * scale - s * 12 * scale); + + return float3x4( + s * float4(f[0][0], f[1][0], f[2][0], f[3][0]), + s * float4(f[0][1], f[1][1], f[2][1], f[3][1]), + s * float4(f[0][2], f[1][2], f[2][2], f[3][2])); +} + +// Simplex noise and its Jacobian derivative +// @param v = 3D noise argument +// @param bTiling = whether to repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3 +// @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w +// J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz) +// J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx +// You can use this to compute the noise, gradient, curl, or divergence: +// float3x4 J = JacobianSimplex_ALU(...); +// float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise +// float3 Grad = J[0].xyz; // gradient of J[0].w +// float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]); +// float Div = J[0][0]+J[1][1]+J[2][2]; +// All of these are confirmed to compile out all unneeded terms. +// So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation. +float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize) +{ + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000); + + // corners of tetrahedron + float4x3 T = SimplexCorners(v); + // TODO: uint3 + int3 rand = int3(0); + float4x3 gvec0 = float4x3(1.0); + float4x3 gvec1 = float4x3(1.0); + float4x3 gvec2 = float4x3(1.0); + float4x3 fv = float4x3(1.0); + float3x4 grad = float3x4(1.0); + + // processing of tetrahedral vertices, unrolled + // to compute gradient at each corner + fv[0] = v - T[0]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize)))); + gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][0] = math::dot(gvec0[0], fv[0]); + grad[1][0] = math::dot(gvec1[0], fv[0]); + grad[2][0] = math::dot(gvec2[0], fv[0]); + + fv[1] = v - T[1]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize)))); + gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][1] = math::dot(gvec0[1], fv[1]); + grad[1][1] = math::dot(gvec1[1], fv[1]); + grad[2][1] = math::dot(gvec2[1], fv[1]); + + fv[2] = v - T[2]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize)))); + gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][2] = math::dot(gvec0[2], fv[2]); + grad[1][2] = math::dot(gvec1[2], fv[2]); + grad[2][2] = math::dot(gvec2[2], fv[2]); + + fv[3] = v - T[3]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize)))); + gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][3] = math::dot(gvec0[3], fv[3]); + grad[1][3] = math::dot(gvec1[3], fv[3]); + grad[2][3] = math::dot(gvec2[3], fv[3]); + + // blend gradients + float4 sv = SimplexSmooth(fv); + float3x4 ds = SimplexDSmooth(fv); + + float3x4 jacobian = float3x4(1.0); + float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major) + jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0])); + float3 vec1 = gvec1*sv + grad[1]*ds; + jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1])); + float3 vec2 = gvec2*sv + grad[2]*ds; + jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2])); + + return jacobian; +} + +// While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes +// floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion. +float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize) +{ + // verified, HLSL compiled out the switch if Function is a constant + switch(Function) + { + case 0: + return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position); + case 1: + return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize); + case 2: + return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position); + case 3: + return GradientNoise3D_ALU(Position, bTiling, RepeatSize); + case 4: + return ValueNoise3D_ALU(Position, bTiling, RepeatSize); + case 5: + return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0; + } + return 0; +} +//---------------------------------------------------------- + +export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize) +[[ + anno::description("Noise"), + anno::noinline() +]] +{ + Position *= Scale; + FilterWidth *= Scale; + + float Out = 0.0f; + float OutScale = 1.0f; + float InvLevelScale = 1.0f / LevelScale; + + int iFunction(Function); + int iQuality(Quality); + int iLevels(Levels); + bool bTurbulence(Turbulence); + bool bTiling(Tiling); + + for(int i = 0; i < iLevels; ++i) + { + // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions) + OutScale *= math::saturate(1.0 - FilterWidth); + + if(bTurbulence) + { + Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale; + } + else + { + Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale; + } + + Position *= LevelScale; + RepeatSize *= LevelScale; + OutScale *= InvLevelScale; + FilterWidth *= LevelScale; + } + + if(!bTurbulence) + { + // bring -1..1 to 0..1 range + Out = Out * 0.5f + 0.5f; + } + + // Out is in 0..1 range + return math::lerp(OutputMin, OutputMax, Out); +} + +// Material node for noise functions returning a vector value +// @param LevelScale usually 2 but higher values allow efficient use of few levels +// @return in user defined range (OutputMin..OutputMax) +export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise"), + anno::noinline() +]] +{ + float4 result = float4(0,0,0,1); + float3 ret = float3(0); + int iQuality = int(Quality); + int iFunction = int(Function); + bool bTiling = Tiling > 0.0; + + float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used + + // verified, HLSL compiled out the switch if Function is a constant + switch (iFunction) + { + case 0: // Cellnoise + ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff; + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 1: // Color noise + ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 2: // Gradient + result = Jacobian[0]; + break; + case 3: // Curl + ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 4: // Voronoi + result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false); + break; + } + return result; +} + +export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise float3 version"), + anno::noinline() +]] +{ + float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize); + return float3(noise.x, noise.y, noise.z); +} + + +// workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view +export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]]) +[[ + anno::description("Fresnel"), + anno::noinline() +]] +{ + return 0.0; +} + +export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]], + bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]], + bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]], + bool clamp_fresnel_dot_product [[anno::unused()]]) +[[ + anno::description("Fresnel Function"), + anno::noinline() +]] +{ + return 0.0; +} + +export float3 camera_vector(uniform bool up_z = true) +[[ + anno::description("Camera Vector"), + anno::noinline() +]] +{ + // assume camera postion is 0,0,0 + return math::normalize(float3(0) - convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)); +} + +export float pixel_depth() +[[ + anno::description("Pixel Depth"), + anno::noinline() +]] +{ + return 256.0f; +} + +export float scene_depth() +[[ + anno::description("Scene Depth") +]] +{ + return 65500.0f; +} + +export float3 scene_color() +[[ + anno::description("Scene Color") +]] +{ + return float3(1.0f); +} + +export float4 vertex_color() +[[ + anno::description("Vertex Color"), + anno::noinline() +]] +{ + return float4(1.0f); +} + +export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex) +[[ + anno::description("Vertex Color for float2 PrimVar"), + anno::noinline() +]] +{ + // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead + return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y); +} + +export float3 camera_position() +[[ + anno::description("Camera Position"), + anno::noinline() +]] +{ + return float3(1000.0f, 0, 0); +} + +export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position) +[[ + anno::description("Rotates Position about the given axis by the given angle") +]] +{ + // Project Position onto the rotation axis and find the closest point on the axis to Position + float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z); + float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis); + // Construct orthogonal axes in the plane of the rotation + float3 UAxis = Position - ClosestPointOnAxis; + float3 VAxis = math::cross(NormalizedRotationAxis, UAxis); + float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w); + // Rotate using the orthogonal axes + float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0]; + // Reconstruct the rotated world space position + float3 RotatedPosition = ClosestPointOnAxis + R; + // Convert from position to a position offset + return RotatedPosition - Position; +} + +export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset) +[[ + anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied") +]] +{ + return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset; +} + +export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal, uniform bool up_z = true) +[[ + anno::description("Reflection vector about the specified world space normal") +]] +{ + if (bNormalizeInputNormal) + { + WorldNormal = math::normalize(WorldNormal); + } + + return -camera_vector(up_z) + WorldNormal * math::dot(WorldNormal, camera_vector(up_z)) * 2.0; +} + +export float3 reflection_vector(uniform bool up_z = true) +[[ + anno::description("Reflection Vector"), + anno::noinline() +]] +{ + float3 normal = convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); + return reflection_custom_world_normal(normal, false, up_z); +} + +export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]]) +[[ + anno::description("Dither TemporalAA"), + anno::noinline() +]] +{ + return AlphaThreshold; +} + +export float3 black_body( float Temp ) +[[ + anno::description("Black Body"), + anno::noinline() +]] +{ + float u = ( 0.860117757f + 1.54118254e-4f * Temp + 1.28641212e-7f * Temp*Temp ) / ( 1.0f + 8.42420235e-4f * Temp + 7.08145163e-7f * Temp*Temp ); + float v = ( 0.317398726f + 4.22806245e-5f * Temp + 4.20481691e-8f * Temp*Temp ) / ( 1.0f - 2.89741816e-5f * Temp + 1.61456053e-7f * Temp*Temp ); + + float x = 3*u / ( 2*u - 8*v + 4 ); + float y = 2*v / ( 2*u - 8*v + 4 ); + float z = 1 - x - y; + + float Y = 1; + float X = Y/y * x; + float Z = Y/y * z; + + float3x3 XYZtoRGB = float3x3( + float3(3.2404542, -1.5371385, -0.4985314), + float3(-0.9692660, 1.8760108, 0.0415560), + float3(0.0556434, -0.2040259, 1.0572252) + ); + + return XYZtoRGB * float3( X, Y, Z ) * math::pow( 0.0004 * Temp, 4 ); +} + +export float per_instance_random(uniform texture_2d PerlinNoiseGradientTexture, int NumberInstances) +[[ + anno::description("Per Instance Random"), + anno::noinline() +]] +{ + float weight = state::object_id() / float(NumberInstances); + return NumberInstances == 0 ? 0.0 : tex::lookup_float4(PerlinNoiseGradientTexture, float2(weight, 1.0 - weight), tex::wrap_repeat, tex::wrap_repeat).x; +} + +//------------------ Hair from UE4 ----------------------- +float3 hair_absorption_to_color(float3 A) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::exp(-math::sqrt(A) * D); +} + +float3 hair_color_to_absorption(float3 C) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::pow(math::log(C) / D, 2.0f); +} + +export float3 get_hair_color_from_melanin(float InMelanin, float InRedness, float3 InDyeColor) +[[ + anno::description("Hair Color") +]] +{ + InMelanin = math::saturate(InMelanin); + InRedness = math::saturate(InRedness); + float Melanin = -math::log(math::max(1 - InMelanin, 0.0001f)); + float Eumelanin = Melanin * (1 - InRedness); + float Pheomelanin = Melanin * InRedness; + + float3 DyeAbsorption = hair_color_to_absorption(math::saturate(InDyeColor)); + float3 Absorption = Eumelanin * float3(0.506f, 0.841f, 1.653f) + Pheomelanin * float3(0.343f, 0.733f, 1.924f); + + return hair_absorption_to_color(Absorption + DyeAbsorption); +} + +export float3 local_object_bounds_min() +[[ + anno::description("Local Object Bounds Min"), + anno::noinline() +]] +{ + return float3(0.0); +} + +export float3 local_object_bounds_max() +[[ + anno::description("Local Object Bounds Max"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float3 object_bounds() +[[ + anno::description("Object Bounds"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float object_radius() +[[ + anno::description("Object Radius"), + anno::noinline() +]] +{ + return 100.0f; +} + +export float3 object_world_position(uniform bool up_z = true) +[[ + anno::description("Object World Position"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)*state::meters_per_scene_unit()*100.0; +} + +export float3 object_orientation() +[[ + anno::description("Object Orientation"), + anno::noinline() +]] +{ + return float3(0); +} + +export float rcp(float x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float2 rcp(float2 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float3 rcp(float3 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float4 rcp(float4 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export int BitFieldExtractI32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractI32 int"), + anno::noinline() +]] +{ + Size &= 3; + Offset &= 3; + + if (Size == 0) + return 0; + else if (Offset + Size < 32) + return (Data << (32 - Size - Offset)) >> (32 - Size); + else + return Data >> Offset; +} + +export int BitFieldExtractI32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractI32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(int(Data), int(Size), int(Offset)); +} + +export int BitFieldExtractU32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractU32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export int BitFieldExtractU32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractU32 int"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export float3 EyeAdaptationInverseLookup(float3 LightValue, float Alpha) +[[ + anno::description("EyeAdaptationInverseLookup"), + anno::noinline() +]] +{ + float Adaptation = 1.0f; + + // When Alpha=0.0, we want to multiply by 1.0. when Alpha = 1.0, we want to multiply by 1/Adaptation. + // So the lerped value is: + // LerpLogScale = Lerp(log(1),log(1/Adaptaiton),T) + // Which is simplified as: + // LerpLogScale = Lerp(0,-log(Adaptation),T) + // LerpLogScale = -T * logAdaptation; + + float LerpLogScale = -Alpha * math::log(Adaptation); + float Scale = math::exp(LerpLogScale); + return LightValue * Scale; +} diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/OmniUe4Translucent.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/OmniUe4Translucent.mdl new file mode 100644 index 0000000000000000000000000000000000000000..483a83004b8f7d5bf820a7905d06ea2d7d5894af --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/OmniUe4Translucent.mdl @@ -0,0 +1,233 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - Emissive color affected by opacity +// - Support opacity mask +//* 1.0.2 - Unlit translucent +//* 1.0.3 - specular bsdf instead of microfacet ggx smith bsdf +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +color get_translucent_tint(color base_color, float opacity) +[[ + anno::description("base color of UE4 translucent"), + anno::noinline() +]] +{ + return math::lerp(color(1.0), base_color, opacity); +} + +// Just for UE4 distilling +float get_translucent_opacity(float opacity) +[[ + anno::noinline() +]] +{ + return opacity; +} + +color get_emissive_intensity(color emissive, float opacity) +[[ + anno::description("emissive color of UE4 translucent"), + anno::noinline() +]] +{ + return emissive * opacity; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - + tangent_v * normal.y + /* flip_tangent_v */ + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Translucent( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float opacity_mask = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform float refraction = 1.0, + uniform bool two_sided = false, + uniform bool is_tangent_space_normal = true, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Translucent"), + anno::description("Omni UE4 Translucent, supports UE4 Translucent shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "translucent")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::min(math::max(metallic, 0.0f), 0.99f); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_opacity = math::saturate(opacity); + float3 final_normal = math::normalize(normal); + + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color)); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + bsdf frosted_bsdf = df::specular_bsdf( + tint: color(1), + mode: df::scatter_reflect_transmit + ); + + bsdf final_mix_bsdf = + is_unlit ? df::specular_bsdf( + tint: get_translucent_tint(base_color: final_base_color, opacity: final_opacity), + mode: df::scatter_reflect_transmit + ) + : df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: dielectric_metal_mix, + weight: get_translucent_opacity(final_opacity)), + df::bsdf_component( + component: frosted_bsdf, + weight: 1.0-get_translucent_opacity(final_opacity)) + ) + ); +} +in material( + thin_walled: two_sided, // Graphene? + ior: color(refraction), //refraction + surface: material_surface( + scattering: final_mix_bsdf, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: get_emissive_intensity(emissive: final_emissive_color, opacity: final_opacity) + ) + ), + + geometry: material_geometry( + displacement: displacement, + normal: the_normal, + cutout_opacity: enable_opacity ? opacity_mask : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/WorldGridMaterial.mdl b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/WorldGridMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8040029cab1073713e0c535664dd57ed7f6b5522 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/SubUSDs/materials/WorldGridMaterial.mdl @@ -0,0 +1,75 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material WorldGridMaterial( + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (CustomizedUV0_mdl / 2.0); + float2 Local1 = (Local0 / 0.05); + float4 Local2 = ::unpack_normal_map(tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_N.png",::tex::gamma_linear),float2(Local1.x,1.0-Local1.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local3 = (float3(Local2.x,Local2.y,Local2.z) * float3(0.3,0.3,1.0)); + + float3 Normal_mdl = Local3; + + float2 Local4 = (CustomizedUV0_mdl * 20.0); + float4 Local5 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat); + float Local6 = math::lerp(0.4,1.0,Local5.x); + float Local7 = (1.0 - Local6); + float2 Local8 = (Local0 / 0.1); + float4 Local9 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local8.x,1.0-Local8.y),tex::wrap_repeat,tex::wrap_repeat); + float Local10 = math::lerp(Local9.y,1.0,0.0); + float Local11 = math::lerp(Local6,Local7,Local10); + float4 Local12 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat); + float Local13 = math::lerp(Local9.y,0.0,0.0); + float Local14 = (Local12.y + Local13); + float Local15 = math::lerp(Local14,0.5,0.5); + float Local16 = math::lerp(0.295,0.66,Local15); + float Local17 = (Local16 * 0.5); + float Local18 = (Local11 * Local17); + float Local19 = math::lerp(0.0,0.5,Local12.y); + float Local20 = math::lerp(0.7,1.0,Local9.y); + float Local21 = math::lerp(Local20,1.0,0.0); + float Local22 = (Local21 * 1.0); + float Local23 = (Local19 + Local22); + float Local24 = math::min(math::max(Local23,0.0),1.0); + + float3 EmissiveColor_mdl = float3(0.0,0.0,0.0); + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = float3(Local18,Local18,Local18); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = Local24; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task10/scene.usda b/assets/scene_usds/ebench/simple_pnp/task10/scene.usda new file mode 100644 index 0000000000000000000000000000000000000000..8509c1a6d712cebbbdcecf66792dfdb1dee99f97 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task10/scene.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_scene" ( + prepend payload = @./scene.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/DayMaterial.mdl b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/DayMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2065d8e637cf60ef12e03a73082728622aaa7044 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/DayMaterial.mdl @@ -0,0 +1,67 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material DayMaterial( + float Flat = 1.0 + [[ + anno::display_name("Flat"), + anno::ui_order(32) + ]], + uniform texture_2d img = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("img"), + anno::ui_order(32), + sampler_color() + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + + float3 Normal_mdl = float3(0.0,0.0,1.0); + + float4 Local0 = tex::lookup_float4(img,float2(CustomizedUV0_mdl.x,1.0-CustomizedUV0_mdl.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local1 = (Flat * float3(Local0.x,Local0.y,Local0.z)); + + float3 EmissiveColor_mdl = Local1; + float Opacity_mdl = Local0.w; + float OpacityMask_mdl = (math::saturate(Local0.w) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = float3(0.0,0.0,0.0); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = 0.5; + float2 Refraction_mdl = float2(float2(1.0,0.0).x,float2(1.0,0.0).x); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num595dea1c4a4d2c1bdcb4db21.mdl b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num595dea1c4a4d2c1bdcb4db21.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d4341409dbe4afe8631ae1bea51ef4edc28f0dd6 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num595dea1c4a4d2c1bdcb4db21.mdl @@ -0,0 +1,307 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num595dea1c4a4d2c1bdcb4db21( + uniform texture_2d Normal_Tex = texture_2d("../textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float Opacity = 0.5 + [[ + anno::display_name("Opacity"), + anno::ui_order(32), + anno::in_group("Translucent") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + uniform float SwitchRefraction = 0.0 + [[ + anno::display_name("SwitchRefraction"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + uniform float FresnelB = 1.517 + [[ + anno::display_name("FresnelB"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + float Local89 = ((math::abs(SwitchRefraction - 1.0) > 0.01) ? (1.0) : FresnelB); + + float3 EmissiveColor_mdl = Local28; + float Opacity_mdl = Opacity; + float OpacityMask_mdl = (math::saturate(Opacity) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + float2 Refraction_mdl = float2(Local89,Local89); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num5aa50614ed99464021093747.mdl b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num5aa50614ed99464021093747.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8bd36a67b1fd659f752921b104a8203471f3186d --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num5aa50614ed99464021093747.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5aa50614ed99464021093747( + uniform texture_2d Normal_Tex = texture_2d("../textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num5ba237dfef62e00d0e012619.mdl b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num5ba237dfef62e00d0e012619.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e0c97f76cfd548741f769a00bb6e3fc3485756e7 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num5ba237dfef62e00d0e012619.mdl @@ -0,0 +1,307 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5ba237dfef62e00d0e012619( + uniform texture_2d Normal_Tex = texture_2d("../textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float Opacity = 0.5 + [[ + anno::display_name("Opacity"), + anno::ui_order(32), + anno::in_group("Translucent") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + uniform float SwitchRefraction = 0.0 + [[ + anno::display_name("SwitchRefraction"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + uniform float FresnelB = 1.517 + [[ + anno::display_name("FresnelB"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + float Local89 = ((math::abs(SwitchRefraction - 1.0) > 0.01) ? (1.0) : FresnelB); + + float3 EmissiveColor_mdl = Local28; + float Opacity_mdl = Opacity; + float OpacityMask_mdl = (math::saturate(Opacity) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + float2 Refraction_mdl = float2(Local89,Local89); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num60ba139e7fdaa40001e0483a.mdl b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num60ba139e7fdaa40001e0483a.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1d2a016eeb92a078326771049dd46f317dbc3ef9 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/Num60ba139e7fdaa40001e0483a.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num60ba139e7fdaa40001e0483a( + uniform texture_2d Normal_Tex = texture_2d("../textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/OmniUe4Base.mdl b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/OmniUe4Base.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a441fbaf28040302c7aaabfbcf14b24a85bdf643 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/OmniUe4Base.mdl @@ -0,0 +1,224 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - merge unlit template +//* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side +//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - /* flip_tangent_v */ + tangent_v * normal.y + + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Base( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + float clearcoat_weight = 0.0, + float clearcoat_roughness = 0.0, + float3 clearcoat_normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform bool is_tangent_space_normal = true, + uniform bool two_sided = false, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Base"), + anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::saturate(metallic); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_clearcoat_weight = math::saturate(clearcoat_weight); + float final_clearcoat_roughness = math::saturate(clearcoat_roughness); + float3 final_normal = math::normalize(normal); + float3 final_clearcoat_normal = math::normalize(clearcoat_normal); + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color), + normal: the_normal); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + // clearcoat layer + float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0); + float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness; + + float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ); + + + bsdf clearcoat = + df::custom_curve_layer( + base: df::weighted_layer( + layer: dielectric_metal_mix, + weight: 1.0, + normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal + ), + layer: df::microfacet_ggx_smith_bsdf( + roughness_u: clearcoat_alpha, + tint: color(1.0) + ), + normal_reflectivity: 0.04, + grazing_reflectivity: clearcoat_grazing_refl, + normal: the_clearcoat_normal, + weight: final_clearcoat_weight + ); + bsdf surface = is_unlit ? bsdf() : clearcoat; +} +in material( + thin_walled: two_sided, // Graphene? + surface: material_surface( + scattering: surface, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + backface: material_surface( + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + geometry: material_geometry( + displacement: displacement, + normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(), + cutout_opacity: enable_opacity ? opacity : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/OmniUe4Function.mdl b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/OmniUe4Function.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0801afff6f0870ea2574c9e9b6e2043e79e9a79 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/OmniUe4Function.mdl @@ -0,0 +1,1413 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.1 - using absolute import paths when importing standard modules + +mdl 1.6; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + + +export float3 convert_to_left_hand(float3 vec3, uniform bool up_z = true, uniform bool is_position = true) +[[ + anno::description("convert from RH to LH"), + anno::noinline() +]] +{ + float4x4 ZupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4x4 YupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4 vec4 = float4(vec3.x, vec3.y, vec3.z, is_position ? 1.0f : 0.0f); + + vec4 = vec4 * (up_z ? ZupConversion : YupConversion); + + return float3(vec4.x, vec4.y, vec4.z); +} + +export float3 transform_vector_from_tangent_to_world(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from tangent space to world space"), + anno::noinline() +]] +{ + /* flip_tangent_v */ + return convert_to_left_hand( + tangent_u * vector.x - tangent_v * vector.y + state::normal() * vector.z, + up_z, false); +} + +export float3 transform_vector_from_world_to_tangent(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from world space to tangent space"), + anno::noinline() +]] +{ + float3 vecRH = convert_to_left_hand(vector, up_z, false); + /* flip_tangent_v */ + return vecRH.x * float3(tangent_u.x, -tangent_v.x, state::normal().x) + + vecRH.y * float3(tangent_u.y, -tangent_v.y, state::normal().y) + + vecRH.z * float3(tangent_u.z, -tangent_v.z, state::normal().z); +} + +export float4 unpack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Unpack a normal stored in a normal map"), + anno::noinline() +]] +{ + float2 normal_xy = float2(texture_sample.x, texture_sample.y); + + normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0); + float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) ); + return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 ); +} + +// for get color value from normal. +export float4 pack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Pack to color from a normal") +]] +{ + float2 return_xy = float2(texture_sample.x, texture_sample.y); + + return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0); + + return float4( return_xy.x, return_xy.y, 0.0, 1.0 ); +} + +export float4 greyscale_texture_lookup( + float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0) + ) +[[ + anno::description("Sampling a greyscale texture"), + anno::noinline() +]] +{ + return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x); +} + +export float3 pixel_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Pixel normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 vertex_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Vertex normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 landscape_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Landscape normal in world space") +]] +{ + float3 normalFromNormalmap = math::floor((::vertex_normal_world_space(up_z) * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0; + + float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y); + return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY)))); +} + +// Different implementation specific between mdl and hlsl for smoothstep +export float smoothstep(float a, float b, float l) +{ + if (a < b) + { + return math::smoothstep(a, b, l); + } + else if (a > b) + { + return 1.0 - math::smoothstep(b, a, l); + } + else + { + return l <= a ? 0.0 : 1.0; + } +} + +export float2 smoothstep(float2 a, float2 b, float2 l) +{ + return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y)); +} + +export float3 smoothstep(float3 a, float3 b, float3 l) +{ + return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z)); +} + +export float4 smoothstep(float4 a, float4 b, float4 l) +{ + return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w)); +} + +export float2 smoothstep(float2 a, float2 b, float l) +{ + return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l)); +} + +export float3 smoothstep(float3 a, float3 b, float l) +{ + return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l)); +} + +export float4 smoothstep(float4 a, float4 b, float l) +{ + return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l)); +} + +export float2 smoothstep(float a, float b, float2 l) +{ + return float2(smoothstep(a, b, l.x), smoothstep(a, b, l.y)); +} + +export float3 smoothstep(float a, float b, float3 l) +{ + return float3(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z)); +} + +export float4 smoothstep(float a, float b, float4 l) +{ + return float4(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z), smoothstep(a, b, l.w)); +} + +//------------------ Random from UE4 ----------------------- +float length2(float3 v) +{ + return math::dot(v, v); +} + +float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v) +{ + const float2 ZShear = float2(17.0f, 89.0f); + + float2 OffsetA = v.z * ZShear; + float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f; + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat); + return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0; +} + +float3 SkewSimplex(float3 In) +{ + return In + math::dot(In, float3(1.0 / 3.0f) ); +} +float3 UnSkewSimplex(float3 In) +{ + return In - math::dot(In, float3(1.0 / 6.0f) ); +} + +// 3D random number generator inspired by PCGs (permuted congruential generator) +// Using a **simple** Feistel cipher in place of the usual xor shift permutation step +// @param v = 3D integer coordinate +// @return three elements w/ 16 random bits each (0-0xffff). +// ~8 ALU operations for result.x (7 mad, 1 >>) +// ~10 ALU operations for result.xy (8 mad, 2 >>) +// ~12 ALU operations for result.xyz (9 mad, 3 >>) + +//TODO: uint3 +int3 Rand3DPCG16(int3 p) +{ + // taking a signed int then reinterpreting as unsigned gives good behavior for negatives + //TODO: uint3 + int3 v = int3(p); + + // Linear congruential step. These LCG constants are from Numerical Recipies + // For additional #'s, PCG would do multiple LCG steps and scramble each on output + // So v here is the RNG state + v = v * 1664525 + 1013904223; + + // PCG uses xorshift for the final shuffle, but it is expensive (and cheap + // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps + // + // Feistel ciphers divide the state into separate parts (usually by bits) + // then apply a series of permutation steps one part at a time. The permutations + // use a reversible operation (usually ^) to part being updated with the result of + // a permutation function on the other parts and the key. + // + // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for + // the combination function, and just multiplying the other two parts (no key) for + // the permutation function. + // + // That gives a simple mad per round. + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + + // only top 16 bits are well shuffled + return v >> 16; +} + +// Wraps noise for tiling texture creation +// @param v = unwrapped texture parameter +// @param bTiling = true to tile, false to not tile +// @param RepeatSize = number of units before repeating +// @return either original or wrapped coord +float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize) +{ + return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v; +} + +// Evaluate polynomial to get smooth transitions for Perlin noise +// only needed by Perlin functions in this file +// scalar(per component): 2 add, 5 mul +float4 PerlinRamp(float4 t) +{ + return t * t * t * (t * (t * 6 - 15) + 10); +} + +// Blum-Blum-Shub-inspired pseudo random number generator +// http://www.umbc.edu/~olano/papers/mNoise.pdf +// real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes +// instead, we use a single prime M just small enough not to overflow +// note that the above paper used 61, which fits in a half, but is unusably bad +// @param Integer valued floating point seed +// @return random number in range [0,1) +// ~8 ALU operations (5 *, 3 frac) +float RandBBSfloat(float seed) +{ + float BBS_PRIME24 = 4093.0; + float s = math::frac(seed / BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + return s; +} + +// Modified noise gradient term +// @param seed - random seed for integer lattice position +// @param offset - [-1,1] offset of evaluation point from lattice point +// @return gradient direction (xyz) and contribution (w) from this lattice point +float4 MGradient(int seed, float3 offset) +{ + //TODO uint + int rand = Rand3DPCG16(int3(seed,0,0)).x; + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000); + float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1; + return float4(direction.x, direction.y, direction.z, math::dot(direction, offset)); +} + +// compute Perlin and related noise corner seed values +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = true to return seed values for a repeating noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @param seed000-seed111 = hash function seeds for the eight corners +// @return fractional part of v +struct SeedValue +{ + float3 fv = float3(0); + float seed000 = 0; + float seed001 = 0; + float seed010 = 0; + float seed011 = 0; + float seed100 = 0; + float seed101 = 0; + float seed110 = 0; + float seed111 = 0; +}; + +SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds; + seeds.fv = math::frac(v); + float3 iv = math::floor(v); + + const float3 primes = float3(19, 47, 101); + + if (bTiling) + { // can't algebraically combine with primes + seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize)); + seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize)); + seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize)); + seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize)); + seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize)); + seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize)); + seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize)); + seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize)); + } + else + { // get to combine offsets with multiplication by primes in this case + seeds.seed000 = math::dot(iv, primes); + seeds.seed100 = seeds.seed000 + primes.x; + seeds.seed010 = seeds.seed000 + primes.y; + seeds.seed110 = seeds.seed100 + primes.y; + seeds.seed001 = seeds.seed000 + primes.z; + seeds.seed101 = seeds.seed100 + primes.z; + seeds.seed011 = seeds.seed010 + primes.z; + seeds.seed111 = seeds.seed110 + primes.z; + } + + return seeds; +} + +struct SimplexWeights +{ + float4 Result = float4(0); + float3 PosA = float3(0); + float3 PosB = float3(0); + float3 PosC = float3(0); + float3 PosD = float3(0); +}; + +// Computed weights and sample positions for simplex interpolation +// @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d +SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos) +{ + SimplexWeights weights; + float3 OrthogonalPosFloor = math::floor(OrthogonalPos); + + weights.PosA = OrthogonalPosFloor; + weights.PosB = weights.PosA + float3(1, 1, 1); + + OrthogonalPos -= OrthogonalPosFloor; + + float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z)); + float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z)); + + weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z); + weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z); + + float RG = OrthogonalPos.x - OrthogonalPos.y; + float RB = OrthogonalPos.x - OrthogonalPos.z; + float GB = OrthogonalPos.y - OrthogonalPos.z; + + weights.Result.z = + math::min(math::max(0, RG), math::max(0, RB)) // X + + math::min(math::max(0, -RG), math::max(0, GB)) // Y + + math::min(math::max(0, -RB), math::max(0, -GB)); // Z + + weights.Result.w = + math::min(math::max(0, -RG), math::max(0, -RB)) // X + + math::min(math::max(0, RG), math::max(0, -GB)) // Y + + math::min(math::max(0, RB), math::max(0, GB)); // Z + + weights.Result.y = Smallest; + weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w; + + return weights; +} + +// filtered 3D gradient simple noise (few texture lookups, high quality) +// @param v >0 +// @return random number in the range -1 .. 1 +float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos) +{ + float3 OrthogonalPos = SkewSimplex(EvalPos); + + SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos); + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit) + float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA); + float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB); + float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC); + float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD); + + Weights.PosA = UnSkewSimplex(Weights.PosA); + Weights.PosB = UnSkewSimplex(Weights.PosB); + Weights.PosC = UnSkewSimplex(Weights.PosC); + Weights.PosD = UnSkewSimplex(Weights.PosD); + + float DistanceWeight; + + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight; + + return 32 * (a + b + c + d); +} + +// filtered 3D noise, can be optimized +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize) +{ + bTiling = true; + float3 fv = math::frac(v); + float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize); + float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize); + + const int2 ZShear = int2(17, 89); + + float2 OffsetA = iv0.z * ZShear; + float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset + if (bTiling) // tiling, have to compute from wrapped coordinates + { + OffsetB = iv1.z * ZShear; + } + + // Texture size scale factor + float ts = 1 / 128.0f; + + // texture coordinates for iv0.xy, as offset for both z slices + float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts; + float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts; + + // texture coordinates for iv1.xy, as offset for both z slices + float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates + float2 TexB1 = TexB0 + ts; + if (bTiling) // for tiling, need to compute from wrapped coordinates + { + TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts; + TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts; + } + + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit) + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 A = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 B = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 C = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 D = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 E = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 F = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 G = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 H = PerlinNoiseColor * 2 - 1; + + float a = math::dot(A, fv - float3(0, 0, 0)); + float b = math::dot(B, fv - float3(1, 0, 0)); + float c = math::dot(C, fv - float3(0, 1, 0)); + float d = math::dot(D, fv - float3(1, 1, 0)); + float e = math::dot(E, fv - float3(0, 0, 1)); + float f = math::dot(F, fv - float3(1, 0, 1)); + float g = math::dot(G, fv - float3(0, 1, 1)); + float h = math::dot(H, fv - float3(1, 1, 1)); + + float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0))); + + float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y); + float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y); + + return math::lerp(i, j, Weights.z); +} + +// @return random number in the range -1 .. 1 +// scalar: 6 frac, 31 mul/mad, 15 add, +float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz) +{ + // needs to be the same value when creating the PerlinNoise3D texture + float Extent = 16; + + // last texel replicated and needed for filtering + // scalar: 3 frac, 6 mul + xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1); + + // scalar: 3 frac + float3 uvw = math::frac(xyz); + // = floor(xyz); + // scalar: 3 add + float3 p0 = xyz - uvw; +// float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping) + // scalar: 2*3 add 5*3 mul + float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0)); + float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping + // scalar: 3 add + float3 p = p0 + f; + // scalar: 3 mad + // TODO: need reverse??? + float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset + + // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count) + // scalar: 4 mad, 3 mul, 3 add + float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f; + float d = NoiseSample.w * 255.f - 127; + return math::dot(xyz, n) - d; +} + +// Perlin-style "Modified Noise" +// http://www.umbc.edu/~olano/papers/index.html#mNoise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w; + float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w; + float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w; + float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w; + float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w; + float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w; + float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w; + float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D value noise - used to be incorrectly called Perlin noise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1; + float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1; + float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1; + float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1; + float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1; + float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1; + float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1; + float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D jitter offset within a voronoi noise cell +// @param pos - integer lattice corner +// @return random offsets vector +float3 VoronoiCornerSample(float3 pos, int Quality) +{ + // random values in [-0.5, 0.5] + float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5; + + // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 2x2x2 search + if (Quality <= 2) + { + return math::normalize(noise) * 0.2588; + } + + // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 3x3x3 search + if (Quality == 3) + { + return math::normalize(noise) * 0.3090; + } + + // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search + return noise; +} + +// compare previous best with a new candidate +// not producing point locations makes it easier for compiler to eliminate calculations when they're not needed +// @param minval = location and distance of best candidate seed point before the new one +// @param candidate = candidate seed point +// @param offset = 3D offset to new candidate seed point +// @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position +// @return position (if bDistanceOnly is false) and distance to closest seed point so far +float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly) +{ + if (bDistanceOnly) + { + return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset))); + } + else + { + float newdist = math::dot(offset, offset); + return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist); + } +} + +// 220 instruction Worley noise +float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly) +{ + float3 fv = math::frac(v), fv2 = math::frac(v + 0.5); + float3 iv = math::floor(v), iv2 = math::floor(v + 0.5); + + // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away + float4 mindist = float4(0,0,0,100); + float3 p, offset; + + // quality level 3: do a 3x3x3 search + if (Quality == 3) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 1; ++offset_x) + { + for (offset_y = -1; offset_y <= 1; ++offset_y) + { + for (offset_z = -1; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + + // everybody else searches a base 2x2x2 neighborhood + else + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = 0; offset_x <= 1; ++offset_x) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // quality level 2, do extra set of points, offset by half a cell + if (Quality == 2) + { + // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + } + + // quality level 4: add extra sets of four cells in each direction + if (Quality >= 4) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 2; offset_x += 3) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + // along x axis + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along y axis + p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along z axis + p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + } + } + } + } + + // transform squared distance to real distance + return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w)); +} + +// Coordinates for corners of a Simplex tetrahedron +// Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011 +// @param v = 3D noise argument +// @return 4 corner locations +float4x3 SimplexCorners(float3 v) +{ + // find base corner by skewing to tetrahedral space and back + float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3); + float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6; + float3 f = v - base; + + // Find offsets to other corners (McEwan did this in tetrahedral space, + // but since skew is along x=y=z axis, this works in Euclidean space too.) + float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y); + float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0; + + // four corners + return float4x3(base, base + a1, base + a2, base + 0.5); +} + +// Improved smoothing function for simplex noise +// @param f = fractional distance to four tetrahedral corners +// @return weight for each corner +float4 SimplexSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale))); +} + +// Derivative of simplex noise smoothing function +// @param f = fractional distanc eto four tetrahedral corners +// @return derivative of smoothing function for each corner by x, y and z +float3x4 SimplexDSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + s = -12 * scale + s*(24 * scale - s * 12 * scale); + + return float3x4( + s * float4(f[0][0], f[1][0], f[2][0], f[3][0]), + s * float4(f[0][1], f[1][1], f[2][1], f[3][1]), + s * float4(f[0][2], f[1][2], f[2][2], f[3][2])); +} + +// Simplex noise and its Jacobian derivative +// @param v = 3D noise argument +// @param bTiling = whether to repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3 +// @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w +// J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz) +// J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx +// You can use this to compute the noise, gradient, curl, or divergence: +// float3x4 J = JacobianSimplex_ALU(...); +// float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise +// float3 Grad = J[0].xyz; // gradient of J[0].w +// float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]); +// float Div = J[0][0]+J[1][1]+J[2][2]; +// All of these are confirmed to compile out all unneeded terms. +// So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation. +float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize) +{ + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000); + + // corners of tetrahedron + float4x3 T = SimplexCorners(v); + // TODO: uint3 + int3 rand = int3(0); + float4x3 gvec0 = float4x3(1.0); + float4x3 gvec1 = float4x3(1.0); + float4x3 gvec2 = float4x3(1.0); + float4x3 fv = float4x3(1.0); + float3x4 grad = float3x4(1.0); + + // processing of tetrahedral vertices, unrolled + // to compute gradient at each corner + fv[0] = v - T[0]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize)))); + gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][0] = math::dot(gvec0[0], fv[0]); + grad[1][0] = math::dot(gvec1[0], fv[0]); + grad[2][0] = math::dot(gvec2[0], fv[0]); + + fv[1] = v - T[1]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize)))); + gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][1] = math::dot(gvec0[1], fv[1]); + grad[1][1] = math::dot(gvec1[1], fv[1]); + grad[2][1] = math::dot(gvec2[1], fv[1]); + + fv[2] = v - T[2]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize)))); + gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][2] = math::dot(gvec0[2], fv[2]); + grad[1][2] = math::dot(gvec1[2], fv[2]); + grad[2][2] = math::dot(gvec2[2], fv[2]); + + fv[3] = v - T[3]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize)))); + gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][3] = math::dot(gvec0[3], fv[3]); + grad[1][3] = math::dot(gvec1[3], fv[3]); + grad[2][3] = math::dot(gvec2[3], fv[3]); + + // blend gradients + float4 sv = SimplexSmooth(fv); + float3x4 ds = SimplexDSmooth(fv); + + float3x4 jacobian = float3x4(1.0); + float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major) + jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0])); + float3 vec1 = gvec1*sv + grad[1]*ds; + jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1])); + float3 vec2 = gvec2*sv + grad[2]*ds; + jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2])); + + return jacobian; +} + +// While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes +// floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion. +float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize) +{ + // verified, HLSL compiled out the switch if Function is a constant + switch(Function) + { + case 0: + return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position); + case 1: + return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize); + case 2: + return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position); + case 3: + return GradientNoise3D_ALU(Position, bTiling, RepeatSize); + case 4: + return ValueNoise3D_ALU(Position, bTiling, RepeatSize); + case 5: + return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0; + } + return 0; +} +//---------------------------------------------------------- + +export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize) +[[ + anno::description("Noise"), + anno::noinline() +]] +{ + Position *= Scale; + FilterWidth *= Scale; + + float Out = 0.0f; + float OutScale = 1.0f; + float InvLevelScale = 1.0f / LevelScale; + + int iFunction(Function); + int iQuality(Quality); + int iLevels(Levels); + bool bTurbulence(Turbulence); + bool bTiling(Tiling); + + for(int i = 0; i < iLevels; ++i) + { + // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions) + OutScale *= math::saturate(1.0 - FilterWidth); + + if(bTurbulence) + { + Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale; + } + else + { + Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale; + } + + Position *= LevelScale; + RepeatSize *= LevelScale; + OutScale *= InvLevelScale; + FilterWidth *= LevelScale; + } + + if(!bTurbulence) + { + // bring -1..1 to 0..1 range + Out = Out * 0.5f + 0.5f; + } + + // Out is in 0..1 range + return math::lerp(OutputMin, OutputMax, Out); +} + +// Material node for noise functions returning a vector value +// @param LevelScale usually 2 but higher values allow efficient use of few levels +// @return in user defined range (OutputMin..OutputMax) +export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise"), + anno::noinline() +]] +{ + float4 result = float4(0,0,0,1); + float3 ret = float3(0); + int iQuality = int(Quality); + int iFunction = int(Function); + bool bTiling = Tiling > 0.0; + + float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used + + // verified, HLSL compiled out the switch if Function is a constant + switch (iFunction) + { + case 0: // Cellnoise + ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff; + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 1: // Color noise + ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 2: // Gradient + result = Jacobian[0]; + break; + case 3: // Curl + ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 4: // Voronoi + result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false); + break; + } + return result; +} + +export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise float3 version"), + anno::noinline() +]] +{ + float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize); + return float3(noise.x, noise.y, noise.z); +} + + +// workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view +export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]]) +[[ + anno::description("Fresnel"), + anno::noinline() +]] +{ + return 0.0; +} + +export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]], + bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]], + bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]], + bool clamp_fresnel_dot_product [[anno::unused()]]) +[[ + anno::description("Fresnel Function"), + anno::noinline() +]] +{ + return 0.0; +} + +export float3 camera_vector(uniform bool up_z = true) +[[ + anno::description("Camera Vector"), + anno::noinline() +]] +{ + // assume camera postion is 0,0,0 + return math::normalize(float3(0) - convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)); +} + +export float pixel_depth() +[[ + anno::description("Pixel Depth"), + anno::noinline() +]] +{ + return 256.0f; +} + +export float scene_depth() +[[ + anno::description("Scene Depth") +]] +{ + return 65500.0f; +} + +export float3 scene_color() +[[ + anno::description("Scene Color") +]] +{ + return float3(1.0f); +} + +export float4 vertex_color() +[[ + anno::description("Vertex Color"), + anno::noinline() +]] +{ + return float4(1.0f); +} + +export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex) +[[ + anno::description("Vertex Color for float2 PrimVar"), + anno::noinline() +]] +{ + // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead + return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y); +} + +export float3 camera_position() +[[ + anno::description("Camera Position"), + anno::noinline() +]] +{ + return float3(1000.0f, 0, 0); +} + +export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position) +[[ + anno::description("Rotates Position about the given axis by the given angle") +]] +{ + // Project Position onto the rotation axis and find the closest point on the axis to Position + float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z); + float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis); + // Construct orthogonal axes in the plane of the rotation + float3 UAxis = Position - ClosestPointOnAxis; + float3 VAxis = math::cross(NormalizedRotationAxis, UAxis); + float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w); + // Rotate using the orthogonal axes + float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0]; + // Reconstruct the rotated world space position + float3 RotatedPosition = ClosestPointOnAxis + R; + // Convert from position to a position offset + return RotatedPosition - Position; +} + +export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset) +[[ + anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied") +]] +{ + return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset; +} + +export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal, uniform bool up_z = true) +[[ + anno::description("Reflection vector about the specified world space normal") +]] +{ + if (bNormalizeInputNormal) + { + WorldNormal = math::normalize(WorldNormal); + } + + return -camera_vector(up_z) + WorldNormal * math::dot(WorldNormal, camera_vector(up_z)) * 2.0; +} + +export float3 reflection_vector(uniform bool up_z = true) +[[ + anno::description("Reflection Vector"), + anno::noinline() +]] +{ + float3 normal = convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); + return reflection_custom_world_normal(normal, false, up_z); +} + +export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]]) +[[ + anno::description("Dither TemporalAA"), + anno::noinline() +]] +{ + return AlphaThreshold; +} + +export float3 black_body( float Temp ) +[[ + anno::description("Black Body"), + anno::noinline() +]] +{ + float u = ( 0.860117757f + 1.54118254e-4f * Temp + 1.28641212e-7f * Temp*Temp ) / ( 1.0f + 8.42420235e-4f * Temp + 7.08145163e-7f * Temp*Temp ); + float v = ( 0.317398726f + 4.22806245e-5f * Temp + 4.20481691e-8f * Temp*Temp ) / ( 1.0f - 2.89741816e-5f * Temp + 1.61456053e-7f * Temp*Temp ); + + float x = 3*u / ( 2*u - 8*v + 4 ); + float y = 2*v / ( 2*u - 8*v + 4 ); + float z = 1 - x - y; + + float Y = 1; + float X = Y/y * x; + float Z = Y/y * z; + + float3x3 XYZtoRGB = float3x3( + float3(3.2404542, -1.5371385, -0.4985314), + float3(-0.9692660, 1.8760108, 0.0415560), + float3(0.0556434, -0.2040259, 1.0572252) + ); + + return XYZtoRGB * float3( X, Y, Z ) * math::pow( 0.0004 * Temp, 4 ); +} + +export float per_instance_random(uniform texture_2d PerlinNoiseGradientTexture, int NumberInstances) +[[ + anno::description("Per Instance Random"), + anno::noinline() +]] +{ + float weight = state::object_id() / float(NumberInstances); + return NumberInstances == 0 ? 0.0 : tex::lookup_float4(PerlinNoiseGradientTexture, float2(weight, 1.0 - weight), tex::wrap_repeat, tex::wrap_repeat).x; +} + +//------------------ Hair from UE4 ----------------------- +float3 hair_absorption_to_color(float3 A) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::exp(-math::sqrt(A) * D); +} + +float3 hair_color_to_absorption(float3 C) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::pow(math::log(C) / D, 2.0f); +} + +export float3 get_hair_color_from_melanin(float InMelanin, float InRedness, float3 InDyeColor) +[[ + anno::description("Hair Color") +]] +{ + InMelanin = math::saturate(InMelanin); + InRedness = math::saturate(InRedness); + float Melanin = -math::log(math::max(1 - InMelanin, 0.0001f)); + float Eumelanin = Melanin * (1 - InRedness); + float Pheomelanin = Melanin * InRedness; + + float3 DyeAbsorption = hair_color_to_absorption(math::saturate(InDyeColor)); + float3 Absorption = Eumelanin * float3(0.506f, 0.841f, 1.653f) + Pheomelanin * float3(0.343f, 0.733f, 1.924f); + + return hair_absorption_to_color(Absorption + DyeAbsorption); +} + +export float3 local_object_bounds_min() +[[ + anno::description("Local Object Bounds Min"), + anno::noinline() +]] +{ + return float3(0.0); +} + +export float3 local_object_bounds_max() +[[ + anno::description("Local Object Bounds Max"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float3 object_bounds() +[[ + anno::description("Object Bounds"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float object_radius() +[[ + anno::description("Object Radius"), + anno::noinline() +]] +{ + return 100.0f; +} + +export float3 object_world_position(uniform bool up_z = true) +[[ + anno::description("Object World Position"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)*state::meters_per_scene_unit()*100.0; +} + +export float3 object_orientation() +[[ + anno::description("Object Orientation"), + anno::noinline() +]] +{ + return float3(0); +} + +export float rcp(float x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float2 rcp(float2 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float3 rcp(float3 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float4 rcp(float4 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export int BitFieldExtractI32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractI32 int"), + anno::noinline() +]] +{ + Size &= 3; + Offset &= 3; + + if (Size == 0) + return 0; + else if (Offset + Size < 32) + return (Data << (32 - Size - Offset)) >> (32 - Size); + else + return Data >> Offset; +} + +export int BitFieldExtractI32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractI32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(int(Data), int(Size), int(Offset)); +} + +export int BitFieldExtractU32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractU32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export int BitFieldExtractU32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractU32 int"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export float3 EyeAdaptationInverseLookup(float3 LightValue, float Alpha) +[[ + anno::description("EyeAdaptationInverseLookup"), + anno::noinline() +]] +{ + float Adaptation = 1.0f; + + // When Alpha=0.0, we want to multiply by 1.0. when Alpha = 1.0, we want to multiply by 1/Adaptation. + // So the lerped value is: + // LerpLogScale = Lerp(log(1),log(1/Adaptaiton),T) + // Which is simplified as: + // LerpLogScale = Lerp(0,-log(Adaptation),T) + // LerpLogScale = -T * logAdaptation; + + float LerpLogScale = -Alpha * math::log(Adaptation); + float Scale = math::exp(LerpLogScale); + return LightValue * Scale; +} diff --git a/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/OmniUe4Translucent.mdl b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/OmniUe4Translucent.mdl new file mode 100644 index 0000000000000000000000000000000000000000..483a83004b8f7d5bf820a7905d06ea2d7d5894af --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/OmniUe4Translucent.mdl @@ -0,0 +1,233 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - Emissive color affected by opacity +// - Support opacity mask +//* 1.0.2 - Unlit translucent +//* 1.0.3 - specular bsdf instead of microfacet ggx smith bsdf +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +color get_translucent_tint(color base_color, float opacity) +[[ + anno::description("base color of UE4 translucent"), + anno::noinline() +]] +{ + return math::lerp(color(1.0), base_color, opacity); +} + +// Just for UE4 distilling +float get_translucent_opacity(float opacity) +[[ + anno::noinline() +]] +{ + return opacity; +} + +color get_emissive_intensity(color emissive, float opacity) +[[ + anno::description("emissive color of UE4 translucent"), + anno::noinline() +]] +{ + return emissive * opacity; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - + tangent_v * normal.y + /* flip_tangent_v */ + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Translucent( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float opacity_mask = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform float refraction = 1.0, + uniform bool two_sided = false, + uniform bool is_tangent_space_normal = true, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Translucent"), + anno::description("Omni UE4 Translucent, supports UE4 Translucent shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "translucent")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::min(math::max(metallic, 0.0f), 0.99f); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_opacity = math::saturate(opacity); + float3 final_normal = math::normalize(normal); + + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color)); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + bsdf frosted_bsdf = df::specular_bsdf( + tint: color(1), + mode: df::scatter_reflect_transmit + ); + + bsdf final_mix_bsdf = + is_unlit ? df::specular_bsdf( + tint: get_translucent_tint(base_color: final_base_color, opacity: final_opacity), + mode: df::scatter_reflect_transmit + ) + : df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: dielectric_metal_mix, + weight: get_translucent_opacity(final_opacity)), + df::bsdf_component( + component: frosted_bsdf, + weight: 1.0-get_translucent_opacity(final_opacity)) + ) + ); +} +in material( + thin_walled: two_sided, // Graphene? + ior: color(refraction), //refraction + surface: material_surface( + scattering: final_mix_bsdf, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: get_emissive_intensity(emissive: final_emissive_color, opacity: final_opacity) + ) + ), + + geometry: material_geometry( + displacement: displacement, + normal: the_normal, + cutout_opacity: enable_opacity ? opacity_mask : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/WorldGridMaterial.mdl b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/WorldGridMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8040029cab1073713e0c535664dd57ed7f6b5522 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task2/SubUSDs/materials/WorldGridMaterial.mdl @@ -0,0 +1,75 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material WorldGridMaterial( + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (CustomizedUV0_mdl / 2.0); + float2 Local1 = (Local0 / 0.05); + float4 Local2 = ::unpack_normal_map(tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_N.png",::tex::gamma_linear),float2(Local1.x,1.0-Local1.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local3 = (float3(Local2.x,Local2.y,Local2.z) * float3(0.3,0.3,1.0)); + + float3 Normal_mdl = Local3; + + float2 Local4 = (CustomizedUV0_mdl * 20.0); + float4 Local5 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat); + float Local6 = math::lerp(0.4,1.0,Local5.x); + float Local7 = (1.0 - Local6); + float2 Local8 = (Local0 / 0.1); + float4 Local9 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local8.x,1.0-Local8.y),tex::wrap_repeat,tex::wrap_repeat); + float Local10 = math::lerp(Local9.y,1.0,0.0); + float Local11 = math::lerp(Local6,Local7,Local10); + float4 Local12 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat); + float Local13 = math::lerp(Local9.y,0.0,0.0); + float Local14 = (Local12.y + Local13); + float Local15 = math::lerp(Local14,0.5,0.5); + float Local16 = math::lerp(0.295,0.66,Local15); + float Local17 = (Local16 * 0.5); + float Local18 = (Local11 * Local17); + float Local19 = math::lerp(0.0,0.5,Local12.y); + float Local20 = math::lerp(0.7,1.0,Local9.y); + float Local21 = math::lerp(Local20,1.0,0.0); + float Local22 = (Local21 * 1.0); + float Local23 = (Local19 + Local22); + float Local24 = math::min(math::max(Local23,0.0),1.0); + + float3 EmissiveColor_mdl = float3(0.0,0.0,0.0); + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = float3(Local18,Local18,Local18); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = Local24; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task2/scene.usda b/assets/scene_usds/ebench/simple_pnp/task2/scene.usda new file mode 100644 index 0000000000000000000000000000000000000000..8509c1a6d712cebbbdcecf66792dfdb1dee99f97 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task2/scene.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_scene" ( + prepend payload = @./scene.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/KooPbr.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/KooPbr.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5e993afd51fcee2e32fb4d95cd3570aff2eb9405 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/KooPbr.mdl @@ -0,0 +1,462 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::anno::*; +import ::df::*; +import ::df::color_weighted_layer; +import ::math::*; +import ::state::*; + +export material KooMtl2Sided( + material frontMtl = material() [[ + anno::in_group("Parameters"), + anno::display_name("Front material") + ]], + material backMtl = frontMtl [[ + anno::in_group("Parameters"), + anno::display_name("Back material") + ]], + uniform bool use_backMtl = false [[ + anno::in_group("Parameters"), + anno::display_name("Use back material") + ]], + color translucency = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Basic parameters"), + anno::display_name("Translucency") + ]], + color front_tint = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Front tint"), + anno::hidden() + ]], + color back_tint = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Back tint"), + anno::hidden() + ]], + uniform bool multiply_by_front_diffuse = false [[ + anno::in_group("Basic parameters"), + anno::display_name("Multiply by front diffuse"), + anno::unused(), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + bsdf transmission_bsdf = + df::diffuse_transmission_bsdf(tint: (front_tint + back_tint)*0.5f); + + bsdf front_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : frontMtl.surface.scattering + ); + + bsdf back_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : backMtl.surface.scattering + ); + } in + material( + thin_walled: true, + ior: frontMtl.ior, + surface: material_surface(scattering: front_bsdf), + backface: material_surface(scattering: use_backMtl ? back_bsdf : front_bsdf), + volume: frontMtl.volume, + geometry: frontMtl.geometry + ); + +float emissive_multiplier() uniform +[[ + anno::description("unit conversion from pbrjson emission to mdl"), + anno::noinline() +]] +{ + return 2560.f; +} + +export material KooLightMtl( + color emission = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Emission") + ]], + uniform float emission_mult = 1.f [[ + anno::in_group("Parameters"), + anno::display_name("Mutliplier") + ]], + color opacity = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Opacity") + ]], + uniform bool emit_on_backside = false [[ + anno::in_group("Parameters"), + anno::display_name("Emit light on back side") + ]]) +[[ + anno::author("KooLab") +]] + = + let { + color emission_color = (emission*opacity)*emission_mult * emissive_multiplier(); + + bsdf surface_bsdf = + df::simple_glossy_bsdf + ( + mode: df::scatter_transmit, + tint: color(1.f) - opacity, + roughness_u: 0 + ); + + material_surface emit_surface = material_surface( + scattering: surface_bsdf, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: emission_color) + ); + } in + material( + thin_walled: emit_on_backside, + ior: color(1.f), + surface: emit_surface, + backface: emit_on_backside ? emit_surface : material_surface() + ); + +export material KooMtl( + color diffuse = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("diffuse") + ]], + color reflect = color(0.f, 0.f, 0.f) [[ + anno::in_group("Reflections"), + anno::display_name("reflect") + ]], + float reflect_glossiness = 1.f [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool fresnel = true [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float fresnel_ior = 1.6f [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::hard_range(0.2f, 5.f) + ]], + uniform bool fresnel_ior_lock = true [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refract_ior = 1.6f [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool invert_refraction_ior = false [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + color self_illumination = color(0.f, 0.f, 0.f) [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-Illumination Intensity") + ]], + float anisotropy = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + float3 texmap_bump = state::normal() [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float opacity = 1.f [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + uniform bool thin_walled = false [[ + anno::in_group("Options"), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + float reflection_roughness = math::pow((1.f - reflect_glossiness), 2.f); + + float refl_ior = invert_reflection_ior ? 1.f/(fresnel_ior + 0.01f) : fresnel_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refract_ior + 0.01f) : refract_ior; + + float ior = fresnel_ior_lock ? refr_ior : refl_ior; + float R0 = math::pow((1.f - ior)/(1.f + ior), 2.f); + + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse, + roughness : 0.0f + ), + normal : texmap_bump + ); + + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: fresnel ? reflect : color(1.f), + roughness_u: reflection_roughness + ); + + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: diffuse, + roughness_u: reflection_roughness + ); + + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : fresnel ? color(R0) : reflect, + grazing_reflectivity: fresnel ? color(1.f) : reflect, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ); + } in + material + ( + ior : color(refr_ior), + thin_walled : thin_walled, + surface : material_surface + ( + scattering : surface_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry + ( + cutout_opacity: opacity + ) + ); + +export material KooTranslucentMtl( + color diffuse = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("Diffuse") + ]], + color reflect = color(0.f, 0.f, 0.f) [[ + anno::in_group("Reflections"), + anno::display_name("Reflect") + ]], + float reflect_glossiness = 1.f [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool fresnel = true [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float fresnel_ior = 1.6f [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::soft_range(0.2, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool fresnel_ior_lock = true [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + color refract = color(0.f, 0.f, 0.f) [[ + anno::in_group("Refractions"), + anno::display_name("Refract") + ]], + float refract_glossiness = 1.f [[ + anno::in_group("Refractions"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refract_ior = 1.6f [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool invert_refraction_ior = false [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + color self_illumination = color(0.f, 0.f, 0.f) [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f [[ + anno::in_group("Self-Illumination"), + anno::display_name("Multiplier") + ]], + float anisotropy = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + float3 texmap_bump = state::normal() [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float texmap_opacity = 1.f [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + uniform bool thin_walled = false [[ + anno::in_group("Options"), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + float reflection_roughness = math::pow((1.f - reflect_glossiness), 2.f); + + float refraction_roughness = math::pow((1.f - refract_glossiness), 2.f); + + float refl_ior = invert_reflection_ior ? 1.f/(fresnel_ior + 0.01f) : fresnel_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refract_ior + 0.01f) : refract_ior; + + float ior = fresnel_ior_lock ? refr_ior : refl_ior; + float R0 = math::pow((1.f - ior)/(1.f + ior), 2.f); + + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse, + roughness : 0.f + ), + normal : texmap_bump + ); + + bsdf glossy_transmission_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: color(1.f), + roughness_u: refraction_roughness + ); + + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: fresnel ? reflect : color(1.f), + roughness_u: reflection_roughness + ); + + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: diffuse, + roughness_u: reflection_roughness + ); + + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : fresnel ? color(R0) : reflect, + grazing_reflectivity: fresnel ? color(1.f) : reflect, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : + df::color_weighted_layer + ( + weight : refract, + layer : glossy_transmission_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ), + normal : texmap_bump + ); + } in + material( + thin_walled : thin_walled, + ior : color(refr_ior), + surface : material_surface + ( + scattering : surface_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry(cutout_opacity: texmap_opacity) + ); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a18a1690001fbf439.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a18a1690001fbf439.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7c523fe565c4fe3a2e0e98c74b3998e33c37eda1 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a18a1690001fbf439.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a18a1690001fbf439(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,20],\"version\":\"1.4.1\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.5879999995f, 0.5879999995f, 0.5879999995f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 0.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a18a1690001fbf43a.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a18a1690001fbf43a.mdl new file mode 100644 index 0000000000000000000000000000000000000000..35bad31407a95cd56cc2955a8f81a12e48d652f8 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a18a1690001fbf43a.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a18a1690001fbf43a(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.01960000023f, 0.01960000023f, 0.01960000023f), + reflect: color(0.05000000075f, 0.03999999911f, 0.03999999911f), + reflect_glossiness: 0.6000000238f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a21dcca0001c8daeb.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a21dcca0001c8daeb.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5ec87b3669e971c7ef82867b6771e2a82e732764 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a21dcca0001c8daeb.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a21dcca0001c8daeb(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.8784000278f, 0.3373000026f, 0.3373000026f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a31e8670001f10fd2.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a31e8670001f10fd2.mdl new file mode 100644 index 0000000000000000000000000000000000000000..52e0def605115a562271c5f20c5c14878c7addec --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a31e8670001f10fd2.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a31e8670001f10fd2(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.06270000339f, 0.06669999659f, 0.070600003f), + reflect: color(0.75f, 0.8399999738f, 0.8700000048f), + reflect_glossiness: 0.8000000119f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a3d6ca40001b7acbd.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a3d6ca40001b7acbd.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e68597042841768bfaa967963fcd104436a04096 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a3d6ca40001b7acbd.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a3d6ca40001b7acbd(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.8784000278f, 0.3373000026f, 0.3373000026f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a41c3890001f47836.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a41c3890001f47836.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0013af4fef702a4cf5363f514262ad2384da9d78 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a41c3890001f47836.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a41c3890001f47836(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.8784000278f, 0.3373000026f, 0.3373000026f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a42cf3c0001c60fd4.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a42cf3c0001c60fd4.mdl new file mode 100644 index 0000000000000000000000000000000000000000..911c603b30d596ebe6fd2aa8d2dacf61b284fcd6 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a42cf3c0001c60fd4.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::anno::description; + +export material MI_655dcc9a42cf3c0001c60fd4(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(1.f, 1.f, 1.f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(0.9399999976f, 0.9399999976f, 0.9399999976f), + refract_glossiness: 1.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a501c350001293c70.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a501c350001293c70.mdl new file mode 100644 index 0000000000000000000000000000000000000000..34165ea662baadcd46a672ca0f66a3bfafae4b6c --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a501c350001293c70.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a501c350001293c70(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.01960000023f, 0.01960000023f, 0.01960000023f), + reflect: color(0.1199999973f, 0.1199999973f, 0.1199999973f), + reflect_glossiness: 0.8999999762f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.51699996f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a5bfe510001f04fb8.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a5bfe510001f04fb8.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ffcbd30aa10a00c64a1e0c05476fd603d0d11bfe --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a5bfe510001f04fb8.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::anno::description; + +export material MI_655dcc9a5bfe510001f04fb8(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(1.f, 1.f, 1.f), + reflect: color(0.09000000358f, 0.09000000358f, 0.09000000358f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(1.f, 1.f, 1.f), + refract_glossiness: 1.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a65fe450001c35988.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a65fe450001c35988.mdl new file mode 100644 index 0000000000000000000000000000000000000000..33ce99a4d2339d71db19886a08592ebfebb21392 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a65fe450001c35988.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a65fe450001c35988(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.003899999894f, 0.003899999894f, 0.003899999894f), + reflect: color(0.05000000075f, 0.03999999911f, 0.03999999911f), + reflect_glossiness: 0.6000000238f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a846cd70001fd24bd.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a846cd70001fd24bd.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0e0f07731bf54bb57bd673fd07f356bbd0660dc5 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a846cd70001fd24bd.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a846cd70001fd24bd(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.8784000278f, 0.3373000026f, 0.3373000026f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a86328000019704e5.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a86328000019704e5.mdl new file mode 100644 index 0000000000000000000000000000000000000000..dc15e804767d98a99d5e4cdda893b1b6be1814ac --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a86328000019704e5.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a86328000019704e5(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.0353000015f, 0.0353000015f, 0.0353000015f), + reflect: color(0.1599999964f, 0.1599999964f, 0.1599999964f), + reflect_glossiness: 0.9200000167f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a86328000019704e6.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a86328000019704e6.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ff38b59f87d2e392171af8b7949451f73466bc01 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a86328000019704e6.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a86328000019704e6(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.8980000019f, 0.8980000019f, 0.8980000019f), + reflect: color(0.7099999785f, 0.7099999785f, 0.7099999785f), + reflect_glossiness: 0.9499999881f, + fresnel: true, + fresnel_ior: 1.799999952f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a8dbf9400018c78ed.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a8dbf9400018c78ed.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b6709c81e7e48999f234322abb2e94f83327f7fe --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a8dbf9400018c78ed.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a8dbf9400018c78ed(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.8784000278f, 0.3373000026f, 0.3373000026f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a9237ad0001ba8197.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a9237ad0001ba8197.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3f0f6eb705c3588505d51ed56dd705c6ac3b81c8 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a9237ad0001ba8197.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_655dcc9a9237ad0001ba8197(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,29],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/c00e97e58585d8ddb0f8b16a724d05a13eae31.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.1599999964f, 0.1599999964f, 0.1599999964f), + reflect_glossiness: 0.9200000167f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a9f4dd400018e1d09.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a9f4dd400018e1d09.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6d680c2be2c6a46dc4eced3db908ee1225c67b0e --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9a9f4dd400018e1d09.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9a9f4dd400018e1d09(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.1333000064f, 0.1333000064f, 0.1333000064f), + reflect: color(0.1599999964f, 0.1599999964f, 0.1599999964f), + reflect_glossiness: 0.9200000167f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9aa9ead30001655c08.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9aa9ead30001655c08.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0060e89d4274893942619eedfb0d7cbbb68a2790 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9aa9ead30001655c08.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9aa9ead30001655c08(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.8784000278f, 0.3373000026f, 0.3373000026f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9abf392f000189451c.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9abf392f000189451c.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0834e758d6d1068a3d095278f45bbea25bdd850 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9abf392f000189451c.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9abf392f000189451c(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.06270000339f, 0.06669999659f, 0.070600003f), + reflect: color(0.75f, 0.8399999738f, 0.8700000048f), + reflect_glossiness: 0.8000000119f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9ad6b50e000157727c.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9ad6b50e000157727c.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fb7f0f1c0f4f0c992da43a05efeb02503a6cc867 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9ad6b50e000157727c.mdl @@ -0,0 +1,38 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_bitmap_bump; +import ::KooPbr_maps::KooPbr_falloff; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_655dcc9ad6b50e000157727c(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,30,26],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.06270000339f, 0.06669999659f, 0.070600003f), + reflect: KooPbr_maps::KooPbr_falloff(base::texture_return(tint: color(0.9300000072f, 0.9200000167f, 0.9100000262f), mono: 1.f), base::texture_return(tint: color(0.7300000191f, 0.7200000286f, 0.7099999785f), mono: 1.f)).tint, + reflect_glossiness: 0.8000000119f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::KooPbr_bitmap_bump(1, true, false, true, false, 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, 1.f, 0, texture_2d("../textures/bf77ddc86c270d02747e7d0517103514ab51d0f.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, 0.3000000119f, 1.f, false, false, false, 1.f, 1.f, 0.f), + opacity: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/c9c274d4ea1de7d059cec0a795b3b27e3941935.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9ad8565000012e27ae.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9ad8565000012e27ae.mdl new file mode 100644 index 0000000000000000000000000000000000000000..87703666ef0aa4b958f459e384e9e724a3318b31 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9ad8565000012e27ae.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9ad8565000012e27ae(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.1490000039f, 0.1490000039f, 0.1490000039f), + reflect: color(0.3899999857f, 0.3899999857f, 0.3899999857f), + reflect_glossiness: 0.8500000238f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9adf830200017c3a39.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9adf830200017c3a39.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1aa258be922434f1bfb16b04e80fc42d61a327c9 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9adf830200017c3a39.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9adf830200017c3a39(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.003899999894f, 0.003899999894f, 0.003899999894f), + reflect: color(0.05000000075f, 0.03999999911f, 0.03999999911f), + reflect_glossiness: 0.6000000238f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9afeb6f70001812165.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9afeb6f70001812165.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8307a1ccb9ceea60fd22155be2b3186ccff1667c --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_655dcc9afeb6f70001812165.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_655dcc9afeb6f70001812165(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.8\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.08630000055f, 0.08630000055f, 0.08630000055f), + reflect: color(0.1599999964f, 0.1599999964f, 0.1599999964f), + reflect_glossiness: 0.9200000167f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_6576cd0390c49f0001be062f.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_6576cd0390c49f0001be062f.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fd787b2cf0d1865c691e12af1367e35360e25c8d --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/MI_6576cd0390c49f0001be062f.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd0390c49f0001be062f(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.007799999788f, 0.007799999788f, 0.007799999788f), + reflect: color(0.3490000069f, 0.3490000069f, 0.3490000069f), + reflect_glossiness: 0.8999999762f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/Num5dd77cea7d6a630001bffad3.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/Num5dd77cea7d6a630001bffad3.mdl new file mode 100644 index 0000000000000000000000000000000000000000..17ea94824f0efbccd745d3c7849fde0da391242f --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/Num5dd77cea7d6a630001bffad3.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5dd77cea7d6a630001bffad3( + uniform texture_2d Normal_Tex = texture_2d("../textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/OmniUe4Base.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/OmniUe4Base.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a441fbaf28040302c7aaabfbcf14b24a85bdf643 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/OmniUe4Base.mdl @@ -0,0 +1,224 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - merge unlit template +//* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side +//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - /* flip_tangent_v */ + tangent_v * normal.y + + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Base( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + float clearcoat_weight = 0.0, + float clearcoat_roughness = 0.0, + float3 clearcoat_normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform bool is_tangent_space_normal = true, + uniform bool two_sided = false, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Base"), + anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::saturate(metallic); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_clearcoat_weight = math::saturate(clearcoat_weight); + float final_clearcoat_roughness = math::saturate(clearcoat_roughness); + float3 final_normal = math::normalize(normal); + float3 final_clearcoat_normal = math::normalize(clearcoat_normal); + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color), + normal: the_normal); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + // clearcoat layer + float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0); + float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness; + + float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ); + + + bsdf clearcoat = + df::custom_curve_layer( + base: df::weighted_layer( + layer: dielectric_metal_mix, + weight: 1.0, + normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal + ), + layer: df::microfacet_ggx_smith_bsdf( + roughness_u: clearcoat_alpha, + tint: color(1.0) + ), + normal_reflectivity: 0.04, + grazing_reflectivity: clearcoat_grazing_refl, + normal: the_clearcoat_normal, + weight: final_clearcoat_weight + ); + bsdf surface = is_unlit ? bsdf() : clearcoat; +} +in material( + thin_walled: two_sided, // Graphene? + surface: material_surface( + scattering: surface, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + backface: material_surface( + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + geometry: material_geometry( + displacement: displacement, + normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(), + cutout_opacity: enable_opacity ? opacity : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/OmniUe4Function.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/OmniUe4Function.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0801afff6f0870ea2574c9e9b6e2043e79e9a79 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/OmniUe4Function.mdl @@ -0,0 +1,1413 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.1 - using absolute import paths when importing standard modules + +mdl 1.6; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + + +export float3 convert_to_left_hand(float3 vec3, uniform bool up_z = true, uniform bool is_position = true) +[[ + anno::description("convert from RH to LH"), + anno::noinline() +]] +{ + float4x4 ZupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4x4 YupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4 vec4 = float4(vec3.x, vec3.y, vec3.z, is_position ? 1.0f : 0.0f); + + vec4 = vec4 * (up_z ? ZupConversion : YupConversion); + + return float3(vec4.x, vec4.y, vec4.z); +} + +export float3 transform_vector_from_tangent_to_world(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from tangent space to world space"), + anno::noinline() +]] +{ + /* flip_tangent_v */ + return convert_to_left_hand( + tangent_u * vector.x - tangent_v * vector.y + state::normal() * vector.z, + up_z, false); +} + +export float3 transform_vector_from_world_to_tangent(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from world space to tangent space"), + anno::noinline() +]] +{ + float3 vecRH = convert_to_left_hand(vector, up_z, false); + /* flip_tangent_v */ + return vecRH.x * float3(tangent_u.x, -tangent_v.x, state::normal().x) + + vecRH.y * float3(tangent_u.y, -tangent_v.y, state::normal().y) + + vecRH.z * float3(tangent_u.z, -tangent_v.z, state::normal().z); +} + +export float4 unpack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Unpack a normal stored in a normal map"), + anno::noinline() +]] +{ + float2 normal_xy = float2(texture_sample.x, texture_sample.y); + + normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0); + float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) ); + return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 ); +} + +// for get color value from normal. +export float4 pack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Pack to color from a normal") +]] +{ + float2 return_xy = float2(texture_sample.x, texture_sample.y); + + return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0); + + return float4( return_xy.x, return_xy.y, 0.0, 1.0 ); +} + +export float4 greyscale_texture_lookup( + float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0) + ) +[[ + anno::description("Sampling a greyscale texture"), + anno::noinline() +]] +{ + return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x); +} + +export float3 pixel_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Pixel normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 vertex_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Vertex normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 landscape_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Landscape normal in world space") +]] +{ + float3 normalFromNormalmap = math::floor((::vertex_normal_world_space(up_z) * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0; + + float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y); + return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY)))); +} + +// Different implementation specific between mdl and hlsl for smoothstep +export float smoothstep(float a, float b, float l) +{ + if (a < b) + { + return math::smoothstep(a, b, l); + } + else if (a > b) + { + return 1.0 - math::smoothstep(b, a, l); + } + else + { + return l <= a ? 0.0 : 1.0; + } +} + +export float2 smoothstep(float2 a, float2 b, float2 l) +{ + return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y)); +} + +export float3 smoothstep(float3 a, float3 b, float3 l) +{ + return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z)); +} + +export float4 smoothstep(float4 a, float4 b, float4 l) +{ + return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w)); +} + +export float2 smoothstep(float2 a, float2 b, float l) +{ + return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l)); +} + +export float3 smoothstep(float3 a, float3 b, float l) +{ + return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l)); +} + +export float4 smoothstep(float4 a, float4 b, float l) +{ + return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l)); +} + +export float2 smoothstep(float a, float b, float2 l) +{ + return float2(smoothstep(a, b, l.x), smoothstep(a, b, l.y)); +} + +export float3 smoothstep(float a, float b, float3 l) +{ + return float3(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z)); +} + +export float4 smoothstep(float a, float b, float4 l) +{ + return float4(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z), smoothstep(a, b, l.w)); +} + +//------------------ Random from UE4 ----------------------- +float length2(float3 v) +{ + return math::dot(v, v); +} + +float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v) +{ + const float2 ZShear = float2(17.0f, 89.0f); + + float2 OffsetA = v.z * ZShear; + float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f; + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat); + return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0; +} + +float3 SkewSimplex(float3 In) +{ + return In + math::dot(In, float3(1.0 / 3.0f) ); +} +float3 UnSkewSimplex(float3 In) +{ + return In - math::dot(In, float3(1.0 / 6.0f) ); +} + +// 3D random number generator inspired by PCGs (permuted congruential generator) +// Using a **simple** Feistel cipher in place of the usual xor shift permutation step +// @param v = 3D integer coordinate +// @return three elements w/ 16 random bits each (0-0xffff). +// ~8 ALU operations for result.x (7 mad, 1 >>) +// ~10 ALU operations for result.xy (8 mad, 2 >>) +// ~12 ALU operations for result.xyz (9 mad, 3 >>) + +//TODO: uint3 +int3 Rand3DPCG16(int3 p) +{ + // taking a signed int then reinterpreting as unsigned gives good behavior for negatives + //TODO: uint3 + int3 v = int3(p); + + // Linear congruential step. These LCG constants are from Numerical Recipies + // For additional #'s, PCG would do multiple LCG steps and scramble each on output + // So v here is the RNG state + v = v * 1664525 + 1013904223; + + // PCG uses xorshift for the final shuffle, but it is expensive (and cheap + // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps + // + // Feistel ciphers divide the state into separate parts (usually by bits) + // then apply a series of permutation steps one part at a time. The permutations + // use a reversible operation (usually ^) to part being updated with the result of + // a permutation function on the other parts and the key. + // + // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for + // the combination function, and just multiplying the other two parts (no key) for + // the permutation function. + // + // That gives a simple mad per round. + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + + // only top 16 bits are well shuffled + return v >> 16; +} + +// Wraps noise for tiling texture creation +// @param v = unwrapped texture parameter +// @param bTiling = true to tile, false to not tile +// @param RepeatSize = number of units before repeating +// @return either original or wrapped coord +float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize) +{ + return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v; +} + +// Evaluate polynomial to get smooth transitions for Perlin noise +// only needed by Perlin functions in this file +// scalar(per component): 2 add, 5 mul +float4 PerlinRamp(float4 t) +{ + return t * t * t * (t * (t * 6 - 15) + 10); +} + +// Blum-Blum-Shub-inspired pseudo random number generator +// http://www.umbc.edu/~olano/papers/mNoise.pdf +// real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes +// instead, we use a single prime M just small enough not to overflow +// note that the above paper used 61, which fits in a half, but is unusably bad +// @param Integer valued floating point seed +// @return random number in range [0,1) +// ~8 ALU operations (5 *, 3 frac) +float RandBBSfloat(float seed) +{ + float BBS_PRIME24 = 4093.0; + float s = math::frac(seed / BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + return s; +} + +// Modified noise gradient term +// @param seed - random seed for integer lattice position +// @param offset - [-1,1] offset of evaluation point from lattice point +// @return gradient direction (xyz) and contribution (w) from this lattice point +float4 MGradient(int seed, float3 offset) +{ + //TODO uint + int rand = Rand3DPCG16(int3(seed,0,0)).x; + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000); + float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1; + return float4(direction.x, direction.y, direction.z, math::dot(direction, offset)); +} + +// compute Perlin and related noise corner seed values +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = true to return seed values for a repeating noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @param seed000-seed111 = hash function seeds for the eight corners +// @return fractional part of v +struct SeedValue +{ + float3 fv = float3(0); + float seed000 = 0; + float seed001 = 0; + float seed010 = 0; + float seed011 = 0; + float seed100 = 0; + float seed101 = 0; + float seed110 = 0; + float seed111 = 0; +}; + +SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds; + seeds.fv = math::frac(v); + float3 iv = math::floor(v); + + const float3 primes = float3(19, 47, 101); + + if (bTiling) + { // can't algebraically combine with primes + seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize)); + seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize)); + seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize)); + seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize)); + seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize)); + seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize)); + seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize)); + seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize)); + } + else + { // get to combine offsets with multiplication by primes in this case + seeds.seed000 = math::dot(iv, primes); + seeds.seed100 = seeds.seed000 + primes.x; + seeds.seed010 = seeds.seed000 + primes.y; + seeds.seed110 = seeds.seed100 + primes.y; + seeds.seed001 = seeds.seed000 + primes.z; + seeds.seed101 = seeds.seed100 + primes.z; + seeds.seed011 = seeds.seed010 + primes.z; + seeds.seed111 = seeds.seed110 + primes.z; + } + + return seeds; +} + +struct SimplexWeights +{ + float4 Result = float4(0); + float3 PosA = float3(0); + float3 PosB = float3(0); + float3 PosC = float3(0); + float3 PosD = float3(0); +}; + +// Computed weights and sample positions for simplex interpolation +// @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d +SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos) +{ + SimplexWeights weights; + float3 OrthogonalPosFloor = math::floor(OrthogonalPos); + + weights.PosA = OrthogonalPosFloor; + weights.PosB = weights.PosA + float3(1, 1, 1); + + OrthogonalPos -= OrthogonalPosFloor; + + float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z)); + float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z)); + + weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z); + weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z); + + float RG = OrthogonalPos.x - OrthogonalPos.y; + float RB = OrthogonalPos.x - OrthogonalPos.z; + float GB = OrthogonalPos.y - OrthogonalPos.z; + + weights.Result.z = + math::min(math::max(0, RG), math::max(0, RB)) // X + + math::min(math::max(0, -RG), math::max(0, GB)) // Y + + math::min(math::max(0, -RB), math::max(0, -GB)); // Z + + weights.Result.w = + math::min(math::max(0, -RG), math::max(0, -RB)) // X + + math::min(math::max(0, RG), math::max(0, -GB)) // Y + + math::min(math::max(0, RB), math::max(0, GB)); // Z + + weights.Result.y = Smallest; + weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w; + + return weights; +} + +// filtered 3D gradient simple noise (few texture lookups, high quality) +// @param v >0 +// @return random number in the range -1 .. 1 +float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos) +{ + float3 OrthogonalPos = SkewSimplex(EvalPos); + + SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos); + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit) + float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA); + float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB); + float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC); + float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD); + + Weights.PosA = UnSkewSimplex(Weights.PosA); + Weights.PosB = UnSkewSimplex(Weights.PosB); + Weights.PosC = UnSkewSimplex(Weights.PosC); + Weights.PosD = UnSkewSimplex(Weights.PosD); + + float DistanceWeight; + + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight; + + return 32 * (a + b + c + d); +} + +// filtered 3D noise, can be optimized +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize) +{ + bTiling = true; + float3 fv = math::frac(v); + float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize); + float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize); + + const int2 ZShear = int2(17, 89); + + float2 OffsetA = iv0.z * ZShear; + float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset + if (bTiling) // tiling, have to compute from wrapped coordinates + { + OffsetB = iv1.z * ZShear; + } + + // Texture size scale factor + float ts = 1 / 128.0f; + + // texture coordinates for iv0.xy, as offset for both z slices + float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts; + float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts; + + // texture coordinates for iv1.xy, as offset for both z slices + float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates + float2 TexB1 = TexB0 + ts; + if (bTiling) // for tiling, need to compute from wrapped coordinates + { + TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts; + TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts; + } + + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit) + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 A = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 B = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 C = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 D = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 E = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 F = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 G = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 H = PerlinNoiseColor * 2 - 1; + + float a = math::dot(A, fv - float3(0, 0, 0)); + float b = math::dot(B, fv - float3(1, 0, 0)); + float c = math::dot(C, fv - float3(0, 1, 0)); + float d = math::dot(D, fv - float3(1, 1, 0)); + float e = math::dot(E, fv - float3(0, 0, 1)); + float f = math::dot(F, fv - float3(1, 0, 1)); + float g = math::dot(G, fv - float3(0, 1, 1)); + float h = math::dot(H, fv - float3(1, 1, 1)); + + float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0))); + + float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y); + float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y); + + return math::lerp(i, j, Weights.z); +} + +// @return random number in the range -1 .. 1 +// scalar: 6 frac, 31 mul/mad, 15 add, +float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz) +{ + // needs to be the same value when creating the PerlinNoise3D texture + float Extent = 16; + + // last texel replicated and needed for filtering + // scalar: 3 frac, 6 mul + xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1); + + // scalar: 3 frac + float3 uvw = math::frac(xyz); + // = floor(xyz); + // scalar: 3 add + float3 p0 = xyz - uvw; +// float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping) + // scalar: 2*3 add 5*3 mul + float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0)); + float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping + // scalar: 3 add + float3 p = p0 + f; + // scalar: 3 mad + // TODO: need reverse??? + float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset + + // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count) + // scalar: 4 mad, 3 mul, 3 add + float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f; + float d = NoiseSample.w * 255.f - 127; + return math::dot(xyz, n) - d; +} + +// Perlin-style "Modified Noise" +// http://www.umbc.edu/~olano/papers/index.html#mNoise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w; + float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w; + float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w; + float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w; + float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w; + float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w; + float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w; + float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D value noise - used to be incorrectly called Perlin noise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1; + float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1; + float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1; + float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1; + float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1; + float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1; + float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1; + float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D jitter offset within a voronoi noise cell +// @param pos - integer lattice corner +// @return random offsets vector +float3 VoronoiCornerSample(float3 pos, int Quality) +{ + // random values in [-0.5, 0.5] + float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5; + + // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 2x2x2 search + if (Quality <= 2) + { + return math::normalize(noise) * 0.2588; + } + + // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 3x3x3 search + if (Quality == 3) + { + return math::normalize(noise) * 0.3090; + } + + // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search + return noise; +} + +// compare previous best with a new candidate +// not producing point locations makes it easier for compiler to eliminate calculations when they're not needed +// @param minval = location and distance of best candidate seed point before the new one +// @param candidate = candidate seed point +// @param offset = 3D offset to new candidate seed point +// @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position +// @return position (if bDistanceOnly is false) and distance to closest seed point so far +float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly) +{ + if (bDistanceOnly) + { + return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset))); + } + else + { + float newdist = math::dot(offset, offset); + return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist); + } +} + +// 220 instruction Worley noise +float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly) +{ + float3 fv = math::frac(v), fv2 = math::frac(v + 0.5); + float3 iv = math::floor(v), iv2 = math::floor(v + 0.5); + + // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away + float4 mindist = float4(0,0,0,100); + float3 p, offset; + + // quality level 3: do a 3x3x3 search + if (Quality == 3) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 1; ++offset_x) + { + for (offset_y = -1; offset_y <= 1; ++offset_y) + { + for (offset_z = -1; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + + // everybody else searches a base 2x2x2 neighborhood + else + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = 0; offset_x <= 1; ++offset_x) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // quality level 2, do extra set of points, offset by half a cell + if (Quality == 2) + { + // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + } + + // quality level 4: add extra sets of four cells in each direction + if (Quality >= 4) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 2; offset_x += 3) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + // along x axis + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along y axis + p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along z axis + p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + } + } + } + } + + // transform squared distance to real distance + return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w)); +} + +// Coordinates for corners of a Simplex tetrahedron +// Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011 +// @param v = 3D noise argument +// @return 4 corner locations +float4x3 SimplexCorners(float3 v) +{ + // find base corner by skewing to tetrahedral space and back + float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3); + float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6; + float3 f = v - base; + + // Find offsets to other corners (McEwan did this in tetrahedral space, + // but since skew is along x=y=z axis, this works in Euclidean space too.) + float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y); + float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0; + + // four corners + return float4x3(base, base + a1, base + a2, base + 0.5); +} + +// Improved smoothing function for simplex noise +// @param f = fractional distance to four tetrahedral corners +// @return weight for each corner +float4 SimplexSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale))); +} + +// Derivative of simplex noise smoothing function +// @param f = fractional distanc eto four tetrahedral corners +// @return derivative of smoothing function for each corner by x, y and z +float3x4 SimplexDSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + s = -12 * scale + s*(24 * scale - s * 12 * scale); + + return float3x4( + s * float4(f[0][0], f[1][0], f[2][0], f[3][0]), + s * float4(f[0][1], f[1][1], f[2][1], f[3][1]), + s * float4(f[0][2], f[1][2], f[2][2], f[3][2])); +} + +// Simplex noise and its Jacobian derivative +// @param v = 3D noise argument +// @param bTiling = whether to repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3 +// @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w +// J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz) +// J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx +// You can use this to compute the noise, gradient, curl, or divergence: +// float3x4 J = JacobianSimplex_ALU(...); +// float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise +// float3 Grad = J[0].xyz; // gradient of J[0].w +// float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]); +// float Div = J[0][0]+J[1][1]+J[2][2]; +// All of these are confirmed to compile out all unneeded terms. +// So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation. +float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize) +{ + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000); + + // corners of tetrahedron + float4x3 T = SimplexCorners(v); + // TODO: uint3 + int3 rand = int3(0); + float4x3 gvec0 = float4x3(1.0); + float4x3 gvec1 = float4x3(1.0); + float4x3 gvec2 = float4x3(1.0); + float4x3 fv = float4x3(1.0); + float3x4 grad = float3x4(1.0); + + // processing of tetrahedral vertices, unrolled + // to compute gradient at each corner + fv[0] = v - T[0]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize)))); + gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][0] = math::dot(gvec0[0], fv[0]); + grad[1][0] = math::dot(gvec1[0], fv[0]); + grad[2][0] = math::dot(gvec2[0], fv[0]); + + fv[1] = v - T[1]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize)))); + gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][1] = math::dot(gvec0[1], fv[1]); + grad[1][1] = math::dot(gvec1[1], fv[1]); + grad[2][1] = math::dot(gvec2[1], fv[1]); + + fv[2] = v - T[2]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize)))); + gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][2] = math::dot(gvec0[2], fv[2]); + grad[1][2] = math::dot(gvec1[2], fv[2]); + grad[2][2] = math::dot(gvec2[2], fv[2]); + + fv[3] = v - T[3]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize)))); + gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][3] = math::dot(gvec0[3], fv[3]); + grad[1][3] = math::dot(gvec1[3], fv[3]); + grad[2][3] = math::dot(gvec2[3], fv[3]); + + // blend gradients + float4 sv = SimplexSmooth(fv); + float3x4 ds = SimplexDSmooth(fv); + + float3x4 jacobian = float3x4(1.0); + float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major) + jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0])); + float3 vec1 = gvec1*sv + grad[1]*ds; + jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1])); + float3 vec2 = gvec2*sv + grad[2]*ds; + jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2])); + + return jacobian; +} + +// While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes +// floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion. +float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize) +{ + // verified, HLSL compiled out the switch if Function is a constant + switch(Function) + { + case 0: + return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position); + case 1: + return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize); + case 2: + return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position); + case 3: + return GradientNoise3D_ALU(Position, bTiling, RepeatSize); + case 4: + return ValueNoise3D_ALU(Position, bTiling, RepeatSize); + case 5: + return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0; + } + return 0; +} +//---------------------------------------------------------- + +export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize) +[[ + anno::description("Noise"), + anno::noinline() +]] +{ + Position *= Scale; + FilterWidth *= Scale; + + float Out = 0.0f; + float OutScale = 1.0f; + float InvLevelScale = 1.0f / LevelScale; + + int iFunction(Function); + int iQuality(Quality); + int iLevels(Levels); + bool bTurbulence(Turbulence); + bool bTiling(Tiling); + + for(int i = 0; i < iLevels; ++i) + { + // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions) + OutScale *= math::saturate(1.0 - FilterWidth); + + if(bTurbulence) + { + Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale; + } + else + { + Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale; + } + + Position *= LevelScale; + RepeatSize *= LevelScale; + OutScale *= InvLevelScale; + FilterWidth *= LevelScale; + } + + if(!bTurbulence) + { + // bring -1..1 to 0..1 range + Out = Out * 0.5f + 0.5f; + } + + // Out is in 0..1 range + return math::lerp(OutputMin, OutputMax, Out); +} + +// Material node for noise functions returning a vector value +// @param LevelScale usually 2 but higher values allow efficient use of few levels +// @return in user defined range (OutputMin..OutputMax) +export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise"), + anno::noinline() +]] +{ + float4 result = float4(0,0,0,1); + float3 ret = float3(0); + int iQuality = int(Quality); + int iFunction = int(Function); + bool bTiling = Tiling > 0.0; + + float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used + + // verified, HLSL compiled out the switch if Function is a constant + switch (iFunction) + { + case 0: // Cellnoise + ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff; + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 1: // Color noise + ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 2: // Gradient + result = Jacobian[0]; + break; + case 3: // Curl + ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 4: // Voronoi + result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false); + break; + } + return result; +} + +export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise float3 version"), + anno::noinline() +]] +{ + float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize); + return float3(noise.x, noise.y, noise.z); +} + + +// workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view +export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]]) +[[ + anno::description("Fresnel"), + anno::noinline() +]] +{ + return 0.0; +} + +export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]], + bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]], + bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]], + bool clamp_fresnel_dot_product [[anno::unused()]]) +[[ + anno::description("Fresnel Function"), + anno::noinline() +]] +{ + return 0.0; +} + +export float3 camera_vector(uniform bool up_z = true) +[[ + anno::description("Camera Vector"), + anno::noinline() +]] +{ + // assume camera postion is 0,0,0 + return math::normalize(float3(0) - convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)); +} + +export float pixel_depth() +[[ + anno::description("Pixel Depth"), + anno::noinline() +]] +{ + return 256.0f; +} + +export float scene_depth() +[[ + anno::description("Scene Depth") +]] +{ + return 65500.0f; +} + +export float3 scene_color() +[[ + anno::description("Scene Color") +]] +{ + return float3(1.0f); +} + +export float4 vertex_color() +[[ + anno::description("Vertex Color"), + anno::noinline() +]] +{ + return float4(1.0f); +} + +export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex) +[[ + anno::description("Vertex Color for float2 PrimVar"), + anno::noinline() +]] +{ + // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead + return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y); +} + +export float3 camera_position() +[[ + anno::description("Camera Position"), + anno::noinline() +]] +{ + return float3(1000.0f, 0, 0); +} + +export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position) +[[ + anno::description("Rotates Position about the given axis by the given angle") +]] +{ + // Project Position onto the rotation axis and find the closest point on the axis to Position + float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z); + float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis); + // Construct orthogonal axes in the plane of the rotation + float3 UAxis = Position - ClosestPointOnAxis; + float3 VAxis = math::cross(NormalizedRotationAxis, UAxis); + float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w); + // Rotate using the orthogonal axes + float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0]; + // Reconstruct the rotated world space position + float3 RotatedPosition = ClosestPointOnAxis + R; + // Convert from position to a position offset + return RotatedPosition - Position; +} + +export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset) +[[ + anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied") +]] +{ + return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset; +} + +export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal, uniform bool up_z = true) +[[ + anno::description("Reflection vector about the specified world space normal") +]] +{ + if (bNormalizeInputNormal) + { + WorldNormal = math::normalize(WorldNormal); + } + + return -camera_vector(up_z) + WorldNormal * math::dot(WorldNormal, camera_vector(up_z)) * 2.0; +} + +export float3 reflection_vector(uniform bool up_z = true) +[[ + anno::description("Reflection Vector"), + anno::noinline() +]] +{ + float3 normal = convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); + return reflection_custom_world_normal(normal, false, up_z); +} + +export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]]) +[[ + anno::description("Dither TemporalAA"), + anno::noinline() +]] +{ + return AlphaThreshold; +} + +export float3 black_body( float Temp ) +[[ + anno::description("Black Body"), + anno::noinline() +]] +{ + float u = ( 0.860117757f + 1.54118254e-4f * Temp + 1.28641212e-7f * Temp*Temp ) / ( 1.0f + 8.42420235e-4f * Temp + 7.08145163e-7f * Temp*Temp ); + float v = ( 0.317398726f + 4.22806245e-5f * Temp + 4.20481691e-8f * Temp*Temp ) / ( 1.0f - 2.89741816e-5f * Temp + 1.61456053e-7f * Temp*Temp ); + + float x = 3*u / ( 2*u - 8*v + 4 ); + float y = 2*v / ( 2*u - 8*v + 4 ); + float z = 1 - x - y; + + float Y = 1; + float X = Y/y * x; + float Z = Y/y * z; + + float3x3 XYZtoRGB = float3x3( + float3(3.2404542, -1.5371385, -0.4985314), + float3(-0.9692660, 1.8760108, 0.0415560), + float3(0.0556434, -0.2040259, 1.0572252) + ); + + return XYZtoRGB * float3( X, Y, Z ) * math::pow( 0.0004 * Temp, 4 ); +} + +export float per_instance_random(uniform texture_2d PerlinNoiseGradientTexture, int NumberInstances) +[[ + anno::description("Per Instance Random"), + anno::noinline() +]] +{ + float weight = state::object_id() / float(NumberInstances); + return NumberInstances == 0 ? 0.0 : tex::lookup_float4(PerlinNoiseGradientTexture, float2(weight, 1.0 - weight), tex::wrap_repeat, tex::wrap_repeat).x; +} + +//------------------ Hair from UE4 ----------------------- +float3 hair_absorption_to_color(float3 A) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::exp(-math::sqrt(A) * D); +} + +float3 hair_color_to_absorption(float3 C) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::pow(math::log(C) / D, 2.0f); +} + +export float3 get_hair_color_from_melanin(float InMelanin, float InRedness, float3 InDyeColor) +[[ + anno::description("Hair Color") +]] +{ + InMelanin = math::saturate(InMelanin); + InRedness = math::saturate(InRedness); + float Melanin = -math::log(math::max(1 - InMelanin, 0.0001f)); + float Eumelanin = Melanin * (1 - InRedness); + float Pheomelanin = Melanin * InRedness; + + float3 DyeAbsorption = hair_color_to_absorption(math::saturate(InDyeColor)); + float3 Absorption = Eumelanin * float3(0.506f, 0.841f, 1.653f) + Pheomelanin * float3(0.343f, 0.733f, 1.924f); + + return hair_absorption_to_color(Absorption + DyeAbsorption); +} + +export float3 local_object_bounds_min() +[[ + anno::description("Local Object Bounds Min"), + anno::noinline() +]] +{ + return float3(0.0); +} + +export float3 local_object_bounds_max() +[[ + anno::description("Local Object Bounds Max"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float3 object_bounds() +[[ + anno::description("Object Bounds"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float object_radius() +[[ + anno::description("Object Radius"), + anno::noinline() +]] +{ + return 100.0f; +} + +export float3 object_world_position(uniform bool up_z = true) +[[ + anno::description("Object World Position"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)*state::meters_per_scene_unit()*100.0; +} + +export float3 object_orientation() +[[ + anno::description("Object Orientation"), + anno::noinline() +]] +{ + return float3(0); +} + +export float rcp(float x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float2 rcp(float2 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float3 rcp(float3 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float4 rcp(float4 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export int BitFieldExtractI32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractI32 int"), + anno::noinline() +]] +{ + Size &= 3; + Offset &= 3; + + if (Size == 0) + return 0; + else if (Offset + Size < 32) + return (Data << (32 - Size - Offset)) >> (32 - Size); + else + return Data >> Offset; +} + +export int BitFieldExtractI32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractI32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(int(Data), int(Size), int(Offset)); +} + +export int BitFieldExtractU32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractU32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export int BitFieldExtractU32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractU32 int"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export float3 EyeAdaptationInverseLookup(float3 LightValue, float Alpha) +[[ + anno::description("EyeAdaptationInverseLookup"), + anno::noinline() +]] +{ + float Adaptation = 1.0f; + + // When Alpha=0.0, we want to multiply by 1.0. when Alpha = 1.0, we want to multiply by 1/Adaptation. + // So the lerped value is: + // LerpLogScale = Lerp(log(1),log(1/Adaptaiton),T) + // Which is simplified as: + // LerpLogScale = Lerp(0,-log(Adaptation),T) + // LerpLogScale = -T * logAdaptation; + + float LerpLogScale = -Alpha * math::log(Adaptation); + float Scale = math::exp(LerpLogScale); + return LightValue * Scale; +} diff --git a/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/WorldGridMaterial.mdl b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/WorldGridMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..72f354f352c601b3f3a008f9e9e03e97f35a5a4c --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/SubUSDs/materials/WorldGridMaterial.mdl @@ -0,0 +1,75 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material WorldGridMaterial( + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (CustomizedUV0_mdl / 2.0); + float2 Local1 = (Local0 / 0.05); + float4 Local2 = ::unpack_normal_map(tex::lookup_float4(texture_2d("../textures/WorldGridMaterial/T_Default_Material_Grid_N.png",::tex::gamma_linear),float2(Local1.x,1.0-Local1.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local3 = (float3(Local2.x,Local2.y,Local2.z) * float3(0.3,0.3,1.0)); + + float3 Normal_mdl = Local3; + + float2 Local4 = (CustomizedUV0_mdl * 20.0); + float4 Local5 = tex::lookup_float4(texture_2d("../textures/WorldGridMaterial/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat); + float Local6 = math::lerp(0.4,1.0,Local5.x); + float Local7 = (1.0 - Local6); + float2 Local8 = (Local0 / 0.1); + float4 Local9 = tex::lookup_float4(texture_2d("../textures/WorldGridMaterial/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local8.x,1.0-Local8.y),tex::wrap_repeat,tex::wrap_repeat); + float Local10 = math::lerp(Local9.y,1.0,0.0); + float Local11 = math::lerp(Local6,Local7,Local10); + float4 Local12 = tex::lookup_float4(texture_2d("../textures/WorldGridMaterial/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat); + float Local13 = math::lerp(Local9.y,0.0,0.0); + float Local14 = (Local12.y + Local13); + float Local15 = math::lerp(Local14,0.5,0.5); + float Local16 = math::lerp(0.295,0.66,Local15); + float Local17 = (Local16 * 0.5); + float Local18 = (Local11 * Local17); + float Local19 = math::lerp(0.0,0.5,Local12.y); + float Local20 = math::lerp(0.7,1.0,Local9.y); + float Local21 = math::lerp(Local20,1.0,0.0); + float Local22 = (Local21 * 1.0); + float Local23 = (Local19 + Local22); + float Local24 = math::min(math::max(Local23,0.0),1.0); + + float3 EmissiveColor_mdl = float3(0.0,0.0,0.0); + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = float3(Local18,Local18,Local18); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = Local24; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task3/scene.usda b/assets/scene_usds/ebench/simple_pnp/task3/scene.usda new file mode 100644 index 0000000000000000000000000000000000000000..8509c1a6d712cebbbdcecf66792dfdb1dee99f97 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task3/scene.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_scene" ( + prepend payload = @./scene.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/0.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/0.usda new file mode 100644 index 0000000000000000000000000000000000000000..9f5f5b60d67e98e22e1625d3648ef483e87284e5 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/0.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_0" ( + prepend payload = @./0.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/0_1.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/0_1.usda new file mode 100644 index 0000000000000000000000000000000000000000..70f05e732518b09492b4f6d6cdcab02b720cb429 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/0_1.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_0_1" ( + prepend payload = @./0_1.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/1.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/1.usda new file mode 100644 index 0000000000000000000000000000000000000000..8510577eccc1abcb351ec7258d76d1628f076dda --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/1.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_1" ( + prepend payload = @./1.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/1_1.usd b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/1_1.usd new file mode 100644 index 0000000000000000000000000000000000000000..8c83c7909235653d1e00ea59b3f295cf0805603e Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/1_1.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/1_1.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/1_1.usda new file mode 100644 index 0000000000000000000000000000000000000000..3f1f06b6b2c43f99d0b8c2b0a3aa9f2ccc7a4e14 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/1_1.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_1_1" ( + prepend payload = @./1_1.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/2.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/2.usda new file mode 100644 index 0000000000000000000000000000000000000000..e9c73ec7e466c3704cb0566c852d44d8581df9e3 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/2.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_2" ( + prepend payload = @./2.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/3.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/3.usda new file mode 100644 index 0000000000000000000000000000000000000000..04a5518f32ecae6521ad7615ed7c90b7070537e7 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/3.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_3" ( + prepend payload = @./3.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/5.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/5.usda new file mode 100644 index 0000000000000000000000000000000000000000..2a1e725dd0cc3360fc56675ee4a7a32a41b843ee --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/5.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_5" ( + prepend payload = @./5.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/6.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/6.usda new file mode 100644 index 0000000000000000000000000000000000000000..6cca4d35491fd865c366196ace0359c9b2163acd --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/6.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_6" ( + prepend payload = @./6.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/6_1.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/6_1.usda new file mode 100644 index 0000000000000000000000000000000000000000..81f7c929ce313792e170a92051d655544dbbc4c7 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/6_1.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_6_1" ( + prepend payload = @./6_1.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/8.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/8.usda new file mode 100644 index 0000000000000000000000000000000000000000..a2edea3d89f1f99407798bf5d0890f96c91dd859 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/8.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_8" ( + prepend payload = @./8.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/MVUHLWYKTKJ5EAABAAAAAAI8_usd_dinning_room_0.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/MVUHLWYKTKJ5EAABAAAAAAI8_usd_dinning_room_0.usda new file mode 100644 index 0000000000000000000000000000000000000000..dabbcdf0b403f0bd1c60f8e20d065aac69674aca --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/MVUHLWYKTKJ5EAABAAAAAAI8_usd_dinning_room_0.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_MVUHLWYKTKJ5EAABAAAAAAI8_usd_dinning_room_0" ( + prepend payload = @./MVUHLWYKTKJ5EAABAAAAAAI8_usd_dinning_room_0.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/DayMaterial.mdl b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/DayMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..65dc591357922f38af9d32e14a3aad4ebbe3b4c4 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/DayMaterial.mdl @@ -0,0 +1,67 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material DayMaterial( + float Flat = 1.0 + [[ + anno::display_name("Flat"), + anno::ui_order(32) + ]], + uniform texture_2d img = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("img"), + anno::ui_order(32), + sampler_color() + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + + float3 Normal_mdl = float3(0.0,0.0,1.0); + + float4 Local0 = tex::lookup_float4(img,float2(CustomizedUV0_mdl.x,1.0-CustomizedUV0_mdl.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local1 = (Flat * float3(Local0.x,Local0.y,Local0.z)); + + float3 EmissiveColor_mdl = Local1; + float Opacity_mdl = Local0.w; + float OpacityMask_mdl = (math::saturate(Local0.w) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = float3(0.0,0.0,0.0); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = 0.5; + float2 Refraction_mdl = float2(float2(1.0,0.0).x,float2(1.0,0.0).x); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/Num5e5507e87d6a6300013c8091.mdl b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/Num5e5507e87d6a6300013c8091.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e22d25ff9c36f0e24dd03365f7960d45528f6d75 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/Num5e5507e87d6a6300013c8091.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5e5507e87d6a6300013c8091( + uniform texture_2d Normal_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/Num652802e61ea6be000148b7cd.mdl b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/Num652802e61ea6be000148b7cd.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2da6c632d18f60dece28a115189d79a3cb688ceb --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/Num652802e61ea6be000148b7cd.mdl @@ -0,0 +1,307 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num652802e61ea6be000148b7cd( + uniform texture_2d Normal_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/model_42bfd814921da5caa11f98e41e207019_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float Opacity = 0.5 + [[ + anno::display_name("Opacity"), + anno::ui_order(32), + anno::in_group("Translucent") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + uniform float SwitchRefraction = 0.0 + [[ + anno::display_name("SwitchRefraction"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + uniform float FresnelB = 1.517 + [[ + anno::display_name("FresnelB"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + float Local89 = ((math::abs(SwitchRefraction - 1.0) > 0.01) ? (1.0) : FresnelB); + + float3 EmissiveColor_mdl = Local28; + float Opacity_mdl = Opacity; + float OpacityMask_mdl = (math::saturate(Opacity) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + float2 Refraction_mdl = float2(Local89,Local89); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/OmniUe4Base.mdl b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/OmniUe4Base.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a441fbaf28040302c7aaabfbcf14b24a85bdf643 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/OmniUe4Base.mdl @@ -0,0 +1,224 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - merge unlit template +//* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side +//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - /* flip_tangent_v */ + tangent_v * normal.y + + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Base( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + float clearcoat_weight = 0.0, + float clearcoat_roughness = 0.0, + float3 clearcoat_normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform bool is_tangent_space_normal = true, + uniform bool two_sided = false, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Base"), + anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::saturate(metallic); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_clearcoat_weight = math::saturate(clearcoat_weight); + float final_clearcoat_roughness = math::saturate(clearcoat_roughness); + float3 final_normal = math::normalize(normal); + float3 final_clearcoat_normal = math::normalize(clearcoat_normal); + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color), + normal: the_normal); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + // clearcoat layer + float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0); + float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness; + + float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ); + + + bsdf clearcoat = + df::custom_curve_layer( + base: df::weighted_layer( + layer: dielectric_metal_mix, + weight: 1.0, + normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal + ), + layer: df::microfacet_ggx_smith_bsdf( + roughness_u: clearcoat_alpha, + tint: color(1.0) + ), + normal_reflectivity: 0.04, + grazing_reflectivity: clearcoat_grazing_refl, + normal: the_clearcoat_normal, + weight: final_clearcoat_weight + ); + bsdf surface = is_unlit ? bsdf() : clearcoat; +} +in material( + thin_walled: two_sided, // Graphene? + surface: material_surface( + scattering: surface, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + backface: material_surface( + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + geometry: material_geometry( + displacement: displacement, + normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(), + cutout_opacity: enable_opacity ? opacity : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/OmniUe4Function.mdl b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/OmniUe4Function.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0801afff6f0870ea2574c9e9b6e2043e79e9a79 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/OmniUe4Function.mdl @@ -0,0 +1,1413 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.1 - using absolute import paths when importing standard modules + +mdl 1.6; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + + +export float3 convert_to_left_hand(float3 vec3, uniform bool up_z = true, uniform bool is_position = true) +[[ + anno::description("convert from RH to LH"), + anno::noinline() +]] +{ + float4x4 ZupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4x4 YupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4 vec4 = float4(vec3.x, vec3.y, vec3.z, is_position ? 1.0f : 0.0f); + + vec4 = vec4 * (up_z ? ZupConversion : YupConversion); + + return float3(vec4.x, vec4.y, vec4.z); +} + +export float3 transform_vector_from_tangent_to_world(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from tangent space to world space"), + anno::noinline() +]] +{ + /* flip_tangent_v */ + return convert_to_left_hand( + tangent_u * vector.x - tangent_v * vector.y + state::normal() * vector.z, + up_z, false); +} + +export float3 transform_vector_from_world_to_tangent(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from world space to tangent space"), + anno::noinline() +]] +{ + float3 vecRH = convert_to_left_hand(vector, up_z, false); + /* flip_tangent_v */ + return vecRH.x * float3(tangent_u.x, -tangent_v.x, state::normal().x) + + vecRH.y * float3(tangent_u.y, -tangent_v.y, state::normal().y) + + vecRH.z * float3(tangent_u.z, -tangent_v.z, state::normal().z); +} + +export float4 unpack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Unpack a normal stored in a normal map"), + anno::noinline() +]] +{ + float2 normal_xy = float2(texture_sample.x, texture_sample.y); + + normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0); + float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) ); + return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 ); +} + +// for get color value from normal. +export float4 pack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Pack to color from a normal") +]] +{ + float2 return_xy = float2(texture_sample.x, texture_sample.y); + + return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0); + + return float4( return_xy.x, return_xy.y, 0.0, 1.0 ); +} + +export float4 greyscale_texture_lookup( + float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0) + ) +[[ + anno::description("Sampling a greyscale texture"), + anno::noinline() +]] +{ + return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x); +} + +export float3 pixel_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Pixel normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 vertex_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Vertex normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 landscape_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Landscape normal in world space") +]] +{ + float3 normalFromNormalmap = math::floor((::vertex_normal_world_space(up_z) * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0; + + float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y); + return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY)))); +} + +// Different implementation specific between mdl and hlsl for smoothstep +export float smoothstep(float a, float b, float l) +{ + if (a < b) + { + return math::smoothstep(a, b, l); + } + else if (a > b) + { + return 1.0 - math::smoothstep(b, a, l); + } + else + { + return l <= a ? 0.0 : 1.0; + } +} + +export float2 smoothstep(float2 a, float2 b, float2 l) +{ + return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y)); +} + +export float3 smoothstep(float3 a, float3 b, float3 l) +{ + return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z)); +} + +export float4 smoothstep(float4 a, float4 b, float4 l) +{ + return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w)); +} + +export float2 smoothstep(float2 a, float2 b, float l) +{ + return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l)); +} + +export float3 smoothstep(float3 a, float3 b, float l) +{ + return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l)); +} + +export float4 smoothstep(float4 a, float4 b, float l) +{ + return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l)); +} + +export float2 smoothstep(float a, float b, float2 l) +{ + return float2(smoothstep(a, b, l.x), smoothstep(a, b, l.y)); +} + +export float3 smoothstep(float a, float b, float3 l) +{ + return float3(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z)); +} + +export float4 smoothstep(float a, float b, float4 l) +{ + return float4(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z), smoothstep(a, b, l.w)); +} + +//------------------ Random from UE4 ----------------------- +float length2(float3 v) +{ + return math::dot(v, v); +} + +float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v) +{ + const float2 ZShear = float2(17.0f, 89.0f); + + float2 OffsetA = v.z * ZShear; + float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f; + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat); + return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0; +} + +float3 SkewSimplex(float3 In) +{ + return In + math::dot(In, float3(1.0 / 3.0f) ); +} +float3 UnSkewSimplex(float3 In) +{ + return In - math::dot(In, float3(1.0 / 6.0f) ); +} + +// 3D random number generator inspired by PCGs (permuted congruential generator) +// Using a **simple** Feistel cipher in place of the usual xor shift permutation step +// @param v = 3D integer coordinate +// @return three elements w/ 16 random bits each (0-0xffff). +// ~8 ALU operations for result.x (7 mad, 1 >>) +// ~10 ALU operations for result.xy (8 mad, 2 >>) +// ~12 ALU operations for result.xyz (9 mad, 3 >>) + +//TODO: uint3 +int3 Rand3DPCG16(int3 p) +{ + // taking a signed int then reinterpreting as unsigned gives good behavior for negatives + //TODO: uint3 + int3 v = int3(p); + + // Linear congruential step. These LCG constants are from Numerical Recipies + // For additional #'s, PCG would do multiple LCG steps and scramble each on output + // So v here is the RNG state + v = v * 1664525 + 1013904223; + + // PCG uses xorshift for the final shuffle, but it is expensive (and cheap + // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps + // + // Feistel ciphers divide the state into separate parts (usually by bits) + // then apply a series of permutation steps one part at a time. The permutations + // use a reversible operation (usually ^) to part being updated with the result of + // a permutation function on the other parts and the key. + // + // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for + // the combination function, and just multiplying the other two parts (no key) for + // the permutation function. + // + // That gives a simple mad per round. + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + + // only top 16 bits are well shuffled + return v >> 16; +} + +// Wraps noise for tiling texture creation +// @param v = unwrapped texture parameter +// @param bTiling = true to tile, false to not tile +// @param RepeatSize = number of units before repeating +// @return either original or wrapped coord +float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize) +{ + return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v; +} + +// Evaluate polynomial to get smooth transitions for Perlin noise +// only needed by Perlin functions in this file +// scalar(per component): 2 add, 5 mul +float4 PerlinRamp(float4 t) +{ + return t * t * t * (t * (t * 6 - 15) + 10); +} + +// Blum-Blum-Shub-inspired pseudo random number generator +// http://www.umbc.edu/~olano/papers/mNoise.pdf +// real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes +// instead, we use a single prime M just small enough not to overflow +// note that the above paper used 61, which fits in a half, but is unusably bad +// @param Integer valued floating point seed +// @return random number in range [0,1) +// ~8 ALU operations (5 *, 3 frac) +float RandBBSfloat(float seed) +{ + float BBS_PRIME24 = 4093.0; + float s = math::frac(seed / BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + return s; +} + +// Modified noise gradient term +// @param seed - random seed for integer lattice position +// @param offset - [-1,1] offset of evaluation point from lattice point +// @return gradient direction (xyz) and contribution (w) from this lattice point +float4 MGradient(int seed, float3 offset) +{ + //TODO uint + int rand = Rand3DPCG16(int3(seed,0,0)).x; + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000); + float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1; + return float4(direction.x, direction.y, direction.z, math::dot(direction, offset)); +} + +// compute Perlin and related noise corner seed values +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = true to return seed values for a repeating noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @param seed000-seed111 = hash function seeds for the eight corners +// @return fractional part of v +struct SeedValue +{ + float3 fv = float3(0); + float seed000 = 0; + float seed001 = 0; + float seed010 = 0; + float seed011 = 0; + float seed100 = 0; + float seed101 = 0; + float seed110 = 0; + float seed111 = 0; +}; + +SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds; + seeds.fv = math::frac(v); + float3 iv = math::floor(v); + + const float3 primes = float3(19, 47, 101); + + if (bTiling) + { // can't algebraically combine with primes + seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize)); + seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize)); + seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize)); + seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize)); + seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize)); + seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize)); + seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize)); + seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize)); + } + else + { // get to combine offsets with multiplication by primes in this case + seeds.seed000 = math::dot(iv, primes); + seeds.seed100 = seeds.seed000 + primes.x; + seeds.seed010 = seeds.seed000 + primes.y; + seeds.seed110 = seeds.seed100 + primes.y; + seeds.seed001 = seeds.seed000 + primes.z; + seeds.seed101 = seeds.seed100 + primes.z; + seeds.seed011 = seeds.seed010 + primes.z; + seeds.seed111 = seeds.seed110 + primes.z; + } + + return seeds; +} + +struct SimplexWeights +{ + float4 Result = float4(0); + float3 PosA = float3(0); + float3 PosB = float3(0); + float3 PosC = float3(0); + float3 PosD = float3(0); +}; + +// Computed weights and sample positions for simplex interpolation +// @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d +SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos) +{ + SimplexWeights weights; + float3 OrthogonalPosFloor = math::floor(OrthogonalPos); + + weights.PosA = OrthogonalPosFloor; + weights.PosB = weights.PosA + float3(1, 1, 1); + + OrthogonalPos -= OrthogonalPosFloor; + + float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z)); + float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z)); + + weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z); + weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z); + + float RG = OrthogonalPos.x - OrthogonalPos.y; + float RB = OrthogonalPos.x - OrthogonalPos.z; + float GB = OrthogonalPos.y - OrthogonalPos.z; + + weights.Result.z = + math::min(math::max(0, RG), math::max(0, RB)) // X + + math::min(math::max(0, -RG), math::max(0, GB)) // Y + + math::min(math::max(0, -RB), math::max(0, -GB)); // Z + + weights.Result.w = + math::min(math::max(0, -RG), math::max(0, -RB)) // X + + math::min(math::max(0, RG), math::max(0, -GB)) // Y + + math::min(math::max(0, RB), math::max(0, GB)); // Z + + weights.Result.y = Smallest; + weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w; + + return weights; +} + +// filtered 3D gradient simple noise (few texture lookups, high quality) +// @param v >0 +// @return random number in the range -1 .. 1 +float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos) +{ + float3 OrthogonalPos = SkewSimplex(EvalPos); + + SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos); + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit) + float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA); + float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB); + float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC); + float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD); + + Weights.PosA = UnSkewSimplex(Weights.PosA); + Weights.PosB = UnSkewSimplex(Weights.PosB); + Weights.PosC = UnSkewSimplex(Weights.PosC); + Weights.PosD = UnSkewSimplex(Weights.PosD); + + float DistanceWeight; + + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight; + + return 32 * (a + b + c + d); +} + +// filtered 3D noise, can be optimized +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize) +{ + bTiling = true; + float3 fv = math::frac(v); + float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize); + float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize); + + const int2 ZShear = int2(17, 89); + + float2 OffsetA = iv0.z * ZShear; + float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset + if (bTiling) // tiling, have to compute from wrapped coordinates + { + OffsetB = iv1.z * ZShear; + } + + // Texture size scale factor + float ts = 1 / 128.0f; + + // texture coordinates for iv0.xy, as offset for both z slices + float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts; + float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts; + + // texture coordinates for iv1.xy, as offset for both z slices + float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates + float2 TexB1 = TexB0 + ts; + if (bTiling) // for tiling, need to compute from wrapped coordinates + { + TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts; + TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts; + } + + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit) + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 A = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 B = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 C = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 D = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 E = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 F = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 G = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 H = PerlinNoiseColor * 2 - 1; + + float a = math::dot(A, fv - float3(0, 0, 0)); + float b = math::dot(B, fv - float3(1, 0, 0)); + float c = math::dot(C, fv - float3(0, 1, 0)); + float d = math::dot(D, fv - float3(1, 1, 0)); + float e = math::dot(E, fv - float3(0, 0, 1)); + float f = math::dot(F, fv - float3(1, 0, 1)); + float g = math::dot(G, fv - float3(0, 1, 1)); + float h = math::dot(H, fv - float3(1, 1, 1)); + + float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0))); + + float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y); + float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y); + + return math::lerp(i, j, Weights.z); +} + +// @return random number in the range -1 .. 1 +// scalar: 6 frac, 31 mul/mad, 15 add, +float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz) +{ + // needs to be the same value when creating the PerlinNoise3D texture + float Extent = 16; + + // last texel replicated and needed for filtering + // scalar: 3 frac, 6 mul + xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1); + + // scalar: 3 frac + float3 uvw = math::frac(xyz); + // = floor(xyz); + // scalar: 3 add + float3 p0 = xyz - uvw; +// float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping) + // scalar: 2*3 add 5*3 mul + float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0)); + float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping + // scalar: 3 add + float3 p = p0 + f; + // scalar: 3 mad + // TODO: need reverse??? + float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset + + // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count) + // scalar: 4 mad, 3 mul, 3 add + float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f; + float d = NoiseSample.w * 255.f - 127; + return math::dot(xyz, n) - d; +} + +// Perlin-style "Modified Noise" +// http://www.umbc.edu/~olano/papers/index.html#mNoise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w; + float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w; + float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w; + float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w; + float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w; + float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w; + float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w; + float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D value noise - used to be incorrectly called Perlin noise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1; + float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1; + float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1; + float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1; + float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1; + float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1; + float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1; + float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D jitter offset within a voronoi noise cell +// @param pos - integer lattice corner +// @return random offsets vector +float3 VoronoiCornerSample(float3 pos, int Quality) +{ + // random values in [-0.5, 0.5] + float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5; + + // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 2x2x2 search + if (Quality <= 2) + { + return math::normalize(noise) * 0.2588; + } + + // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 3x3x3 search + if (Quality == 3) + { + return math::normalize(noise) * 0.3090; + } + + // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search + return noise; +} + +// compare previous best with a new candidate +// not producing point locations makes it easier for compiler to eliminate calculations when they're not needed +// @param minval = location and distance of best candidate seed point before the new one +// @param candidate = candidate seed point +// @param offset = 3D offset to new candidate seed point +// @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position +// @return position (if bDistanceOnly is false) and distance to closest seed point so far +float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly) +{ + if (bDistanceOnly) + { + return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset))); + } + else + { + float newdist = math::dot(offset, offset); + return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist); + } +} + +// 220 instruction Worley noise +float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly) +{ + float3 fv = math::frac(v), fv2 = math::frac(v + 0.5); + float3 iv = math::floor(v), iv2 = math::floor(v + 0.5); + + // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away + float4 mindist = float4(0,0,0,100); + float3 p, offset; + + // quality level 3: do a 3x3x3 search + if (Quality == 3) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 1; ++offset_x) + { + for (offset_y = -1; offset_y <= 1; ++offset_y) + { + for (offset_z = -1; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + + // everybody else searches a base 2x2x2 neighborhood + else + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = 0; offset_x <= 1; ++offset_x) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // quality level 2, do extra set of points, offset by half a cell + if (Quality == 2) + { + // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + } + + // quality level 4: add extra sets of four cells in each direction + if (Quality >= 4) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 2; offset_x += 3) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + // along x axis + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along y axis + p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along z axis + p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + } + } + } + } + + // transform squared distance to real distance + return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w)); +} + +// Coordinates for corners of a Simplex tetrahedron +// Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011 +// @param v = 3D noise argument +// @return 4 corner locations +float4x3 SimplexCorners(float3 v) +{ + // find base corner by skewing to tetrahedral space and back + float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3); + float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6; + float3 f = v - base; + + // Find offsets to other corners (McEwan did this in tetrahedral space, + // but since skew is along x=y=z axis, this works in Euclidean space too.) + float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y); + float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0; + + // four corners + return float4x3(base, base + a1, base + a2, base + 0.5); +} + +// Improved smoothing function for simplex noise +// @param f = fractional distance to four tetrahedral corners +// @return weight for each corner +float4 SimplexSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale))); +} + +// Derivative of simplex noise smoothing function +// @param f = fractional distanc eto four tetrahedral corners +// @return derivative of smoothing function for each corner by x, y and z +float3x4 SimplexDSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + s = -12 * scale + s*(24 * scale - s * 12 * scale); + + return float3x4( + s * float4(f[0][0], f[1][0], f[2][0], f[3][0]), + s * float4(f[0][1], f[1][1], f[2][1], f[3][1]), + s * float4(f[0][2], f[1][2], f[2][2], f[3][2])); +} + +// Simplex noise and its Jacobian derivative +// @param v = 3D noise argument +// @param bTiling = whether to repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3 +// @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w +// J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz) +// J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx +// You can use this to compute the noise, gradient, curl, or divergence: +// float3x4 J = JacobianSimplex_ALU(...); +// float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise +// float3 Grad = J[0].xyz; // gradient of J[0].w +// float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]); +// float Div = J[0][0]+J[1][1]+J[2][2]; +// All of these are confirmed to compile out all unneeded terms. +// So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation. +float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize) +{ + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000); + + // corners of tetrahedron + float4x3 T = SimplexCorners(v); + // TODO: uint3 + int3 rand = int3(0); + float4x3 gvec0 = float4x3(1.0); + float4x3 gvec1 = float4x3(1.0); + float4x3 gvec2 = float4x3(1.0); + float4x3 fv = float4x3(1.0); + float3x4 grad = float3x4(1.0); + + // processing of tetrahedral vertices, unrolled + // to compute gradient at each corner + fv[0] = v - T[0]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize)))); + gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][0] = math::dot(gvec0[0], fv[0]); + grad[1][0] = math::dot(gvec1[0], fv[0]); + grad[2][0] = math::dot(gvec2[0], fv[0]); + + fv[1] = v - T[1]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize)))); + gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][1] = math::dot(gvec0[1], fv[1]); + grad[1][1] = math::dot(gvec1[1], fv[1]); + grad[2][1] = math::dot(gvec2[1], fv[1]); + + fv[2] = v - T[2]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize)))); + gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][2] = math::dot(gvec0[2], fv[2]); + grad[1][2] = math::dot(gvec1[2], fv[2]); + grad[2][2] = math::dot(gvec2[2], fv[2]); + + fv[3] = v - T[3]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize)))); + gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][3] = math::dot(gvec0[3], fv[3]); + grad[1][3] = math::dot(gvec1[3], fv[3]); + grad[2][3] = math::dot(gvec2[3], fv[3]); + + // blend gradients + float4 sv = SimplexSmooth(fv); + float3x4 ds = SimplexDSmooth(fv); + + float3x4 jacobian = float3x4(1.0); + float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major) + jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0])); + float3 vec1 = gvec1*sv + grad[1]*ds; + jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1])); + float3 vec2 = gvec2*sv + grad[2]*ds; + jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2])); + + return jacobian; +} + +// While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes +// floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion. +float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize) +{ + // verified, HLSL compiled out the switch if Function is a constant + switch(Function) + { + case 0: + return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position); + case 1: + return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize); + case 2: + return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position); + case 3: + return GradientNoise3D_ALU(Position, bTiling, RepeatSize); + case 4: + return ValueNoise3D_ALU(Position, bTiling, RepeatSize); + case 5: + return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0; + } + return 0; +} +//---------------------------------------------------------- + +export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize) +[[ + anno::description("Noise"), + anno::noinline() +]] +{ + Position *= Scale; + FilterWidth *= Scale; + + float Out = 0.0f; + float OutScale = 1.0f; + float InvLevelScale = 1.0f / LevelScale; + + int iFunction(Function); + int iQuality(Quality); + int iLevels(Levels); + bool bTurbulence(Turbulence); + bool bTiling(Tiling); + + for(int i = 0; i < iLevels; ++i) + { + // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions) + OutScale *= math::saturate(1.0 - FilterWidth); + + if(bTurbulence) + { + Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale; + } + else + { + Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale; + } + + Position *= LevelScale; + RepeatSize *= LevelScale; + OutScale *= InvLevelScale; + FilterWidth *= LevelScale; + } + + if(!bTurbulence) + { + // bring -1..1 to 0..1 range + Out = Out * 0.5f + 0.5f; + } + + // Out is in 0..1 range + return math::lerp(OutputMin, OutputMax, Out); +} + +// Material node for noise functions returning a vector value +// @param LevelScale usually 2 but higher values allow efficient use of few levels +// @return in user defined range (OutputMin..OutputMax) +export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise"), + anno::noinline() +]] +{ + float4 result = float4(0,0,0,1); + float3 ret = float3(0); + int iQuality = int(Quality); + int iFunction = int(Function); + bool bTiling = Tiling > 0.0; + + float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used + + // verified, HLSL compiled out the switch if Function is a constant + switch (iFunction) + { + case 0: // Cellnoise + ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff; + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 1: // Color noise + ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 2: // Gradient + result = Jacobian[0]; + break; + case 3: // Curl + ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 4: // Voronoi + result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false); + break; + } + return result; +} + +export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise float3 version"), + anno::noinline() +]] +{ + float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize); + return float3(noise.x, noise.y, noise.z); +} + + +// workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view +export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]]) +[[ + anno::description("Fresnel"), + anno::noinline() +]] +{ + return 0.0; +} + +export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]], + bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]], + bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]], + bool clamp_fresnel_dot_product [[anno::unused()]]) +[[ + anno::description("Fresnel Function"), + anno::noinline() +]] +{ + return 0.0; +} + +export float3 camera_vector(uniform bool up_z = true) +[[ + anno::description("Camera Vector"), + anno::noinline() +]] +{ + // assume camera postion is 0,0,0 + return math::normalize(float3(0) - convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)); +} + +export float pixel_depth() +[[ + anno::description("Pixel Depth"), + anno::noinline() +]] +{ + return 256.0f; +} + +export float scene_depth() +[[ + anno::description("Scene Depth") +]] +{ + return 65500.0f; +} + +export float3 scene_color() +[[ + anno::description("Scene Color") +]] +{ + return float3(1.0f); +} + +export float4 vertex_color() +[[ + anno::description("Vertex Color"), + anno::noinline() +]] +{ + return float4(1.0f); +} + +export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex) +[[ + anno::description("Vertex Color for float2 PrimVar"), + anno::noinline() +]] +{ + // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead + return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y); +} + +export float3 camera_position() +[[ + anno::description("Camera Position"), + anno::noinline() +]] +{ + return float3(1000.0f, 0, 0); +} + +export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position) +[[ + anno::description("Rotates Position about the given axis by the given angle") +]] +{ + // Project Position onto the rotation axis and find the closest point on the axis to Position + float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z); + float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis); + // Construct orthogonal axes in the plane of the rotation + float3 UAxis = Position - ClosestPointOnAxis; + float3 VAxis = math::cross(NormalizedRotationAxis, UAxis); + float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w); + // Rotate using the orthogonal axes + float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0]; + // Reconstruct the rotated world space position + float3 RotatedPosition = ClosestPointOnAxis + R; + // Convert from position to a position offset + return RotatedPosition - Position; +} + +export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset) +[[ + anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied") +]] +{ + return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset; +} + +export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal, uniform bool up_z = true) +[[ + anno::description("Reflection vector about the specified world space normal") +]] +{ + if (bNormalizeInputNormal) + { + WorldNormal = math::normalize(WorldNormal); + } + + return -camera_vector(up_z) + WorldNormal * math::dot(WorldNormal, camera_vector(up_z)) * 2.0; +} + +export float3 reflection_vector(uniform bool up_z = true) +[[ + anno::description("Reflection Vector"), + anno::noinline() +]] +{ + float3 normal = convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); + return reflection_custom_world_normal(normal, false, up_z); +} + +export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]]) +[[ + anno::description("Dither TemporalAA"), + anno::noinline() +]] +{ + return AlphaThreshold; +} + +export float3 black_body( float Temp ) +[[ + anno::description("Black Body"), + anno::noinline() +]] +{ + float u = ( 0.860117757f + 1.54118254e-4f * Temp + 1.28641212e-7f * Temp*Temp ) / ( 1.0f + 8.42420235e-4f * Temp + 7.08145163e-7f * Temp*Temp ); + float v = ( 0.317398726f + 4.22806245e-5f * Temp + 4.20481691e-8f * Temp*Temp ) / ( 1.0f - 2.89741816e-5f * Temp + 1.61456053e-7f * Temp*Temp ); + + float x = 3*u / ( 2*u - 8*v + 4 ); + float y = 2*v / ( 2*u - 8*v + 4 ); + float z = 1 - x - y; + + float Y = 1; + float X = Y/y * x; + float Z = Y/y * z; + + float3x3 XYZtoRGB = float3x3( + float3(3.2404542, -1.5371385, -0.4985314), + float3(-0.9692660, 1.8760108, 0.0415560), + float3(0.0556434, -0.2040259, 1.0572252) + ); + + return XYZtoRGB * float3( X, Y, Z ) * math::pow( 0.0004 * Temp, 4 ); +} + +export float per_instance_random(uniform texture_2d PerlinNoiseGradientTexture, int NumberInstances) +[[ + anno::description("Per Instance Random"), + anno::noinline() +]] +{ + float weight = state::object_id() / float(NumberInstances); + return NumberInstances == 0 ? 0.0 : tex::lookup_float4(PerlinNoiseGradientTexture, float2(weight, 1.0 - weight), tex::wrap_repeat, tex::wrap_repeat).x; +} + +//------------------ Hair from UE4 ----------------------- +float3 hair_absorption_to_color(float3 A) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::exp(-math::sqrt(A) * D); +} + +float3 hair_color_to_absorption(float3 C) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::pow(math::log(C) / D, 2.0f); +} + +export float3 get_hair_color_from_melanin(float InMelanin, float InRedness, float3 InDyeColor) +[[ + anno::description("Hair Color") +]] +{ + InMelanin = math::saturate(InMelanin); + InRedness = math::saturate(InRedness); + float Melanin = -math::log(math::max(1 - InMelanin, 0.0001f)); + float Eumelanin = Melanin * (1 - InRedness); + float Pheomelanin = Melanin * InRedness; + + float3 DyeAbsorption = hair_color_to_absorption(math::saturate(InDyeColor)); + float3 Absorption = Eumelanin * float3(0.506f, 0.841f, 1.653f) + Pheomelanin * float3(0.343f, 0.733f, 1.924f); + + return hair_absorption_to_color(Absorption + DyeAbsorption); +} + +export float3 local_object_bounds_min() +[[ + anno::description("Local Object Bounds Min"), + anno::noinline() +]] +{ + return float3(0.0); +} + +export float3 local_object_bounds_max() +[[ + anno::description("Local Object Bounds Max"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float3 object_bounds() +[[ + anno::description("Object Bounds"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float object_radius() +[[ + anno::description("Object Radius"), + anno::noinline() +]] +{ + return 100.0f; +} + +export float3 object_world_position(uniform bool up_z = true) +[[ + anno::description("Object World Position"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)*state::meters_per_scene_unit()*100.0; +} + +export float3 object_orientation() +[[ + anno::description("Object Orientation"), + anno::noinline() +]] +{ + return float3(0); +} + +export float rcp(float x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float2 rcp(float2 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float3 rcp(float3 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float4 rcp(float4 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export int BitFieldExtractI32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractI32 int"), + anno::noinline() +]] +{ + Size &= 3; + Offset &= 3; + + if (Size == 0) + return 0; + else if (Offset + Size < 32) + return (Data << (32 - Size - Offset)) >> (32 - Size); + else + return Data >> Offset; +} + +export int BitFieldExtractI32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractI32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(int(Data), int(Size), int(Offset)); +} + +export int BitFieldExtractU32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractU32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export int BitFieldExtractU32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractU32 int"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export float3 EyeAdaptationInverseLookup(float3 LightValue, float Alpha) +[[ + anno::description("EyeAdaptationInverseLookup"), + anno::noinline() +]] +{ + float Adaptation = 1.0f; + + // When Alpha=0.0, we want to multiply by 1.0. when Alpha = 1.0, we want to multiply by 1/Adaptation. + // So the lerped value is: + // LerpLogScale = Lerp(log(1),log(1/Adaptaiton),T) + // Which is simplified as: + // LerpLogScale = Lerp(0,-log(Adaptation),T) + // LerpLogScale = -T * logAdaptation; + + float LerpLogScale = -Alpha * math::log(Adaptation); + float Scale = math::exp(LerpLogScale); + return LightValue * Scale; +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/OmniUe4Translucent.mdl b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/OmniUe4Translucent.mdl new file mode 100644 index 0000000000000000000000000000000000000000..483a83004b8f7d5bf820a7905d06ea2d7d5894af --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/OmniUe4Translucent.mdl @@ -0,0 +1,233 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - Emissive color affected by opacity +// - Support opacity mask +//* 1.0.2 - Unlit translucent +//* 1.0.3 - specular bsdf instead of microfacet ggx smith bsdf +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +color get_translucent_tint(color base_color, float opacity) +[[ + anno::description("base color of UE4 translucent"), + anno::noinline() +]] +{ + return math::lerp(color(1.0), base_color, opacity); +} + +// Just for UE4 distilling +float get_translucent_opacity(float opacity) +[[ + anno::noinline() +]] +{ + return opacity; +} + +color get_emissive_intensity(color emissive, float opacity) +[[ + anno::description("emissive color of UE4 translucent"), + anno::noinline() +]] +{ + return emissive * opacity; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - + tangent_v * normal.y + /* flip_tangent_v */ + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Translucent( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float opacity_mask = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform float refraction = 1.0, + uniform bool two_sided = false, + uniform bool is_tangent_space_normal = true, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Translucent"), + anno::description("Omni UE4 Translucent, supports UE4 Translucent shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "translucent")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::min(math::max(metallic, 0.0f), 0.99f); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_opacity = math::saturate(opacity); + float3 final_normal = math::normalize(normal); + + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color)); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + bsdf frosted_bsdf = df::specular_bsdf( + tint: color(1), + mode: df::scatter_reflect_transmit + ); + + bsdf final_mix_bsdf = + is_unlit ? df::specular_bsdf( + tint: get_translucent_tint(base_color: final_base_color, opacity: final_opacity), + mode: df::scatter_reflect_transmit + ) + : df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: dielectric_metal_mix, + weight: get_translucent_opacity(final_opacity)), + df::bsdf_component( + component: frosted_bsdf, + weight: 1.0-get_translucent_opacity(final_opacity)) + ) + ); +} +in material( + thin_walled: two_sided, // Graphene? + ior: color(refraction), //refraction + surface: material_surface( + scattering: final_mix_bsdf, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: get_emissive_intensity(emissive: final_emissive_color, opacity: final_opacity) + ) + ), + + geometry: material_geometry( + displacement: displacement, + normal: the_normal, + cutout_opacity: enable_opacity ? opacity_mask : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/WorldGridMaterial.mdl b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/WorldGridMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8040029cab1073713e0c535664dd57ed7f6b5522 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/materials/WorldGridMaterial.mdl @@ -0,0 +1,75 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material WorldGridMaterial( + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (CustomizedUV0_mdl / 2.0); + float2 Local1 = (Local0 / 0.05); + float4 Local2 = ::unpack_normal_map(tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_N.png",::tex::gamma_linear),float2(Local1.x,1.0-Local1.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local3 = (float3(Local2.x,Local2.y,Local2.z) * float3(0.3,0.3,1.0)); + + float3 Normal_mdl = Local3; + + float2 Local4 = (CustomizedUV0_mdl * 20.0); + float4 Local5 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat); + float Local6 = math::lerp(0.4,1.0,Local5.x); + float Local7 = (1.0 - Local6); + float2 Local8 = (Local0 / 0.1); + float4 Local9 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local8.x,1.0-Local8.y),tex::wrap_repeat,tex::wrap_repeat); + float Local10 = math::lerp(Local9.y,1.0,0.0); + float Local11 = math::lerp(Local6,Local7,Local10); + float4 Local12 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat); + float Local13 = math::lerp(Local9.y,0.0,0.0); + float Local14 = (Local12.y + Local13); + float Local15 = math::lerp(Local14,0.5,0.5); + float Local16 = math::lerp(0.295,0.66,Local15); + float Local17 = (Local16 * 0.5); + float Local18 = (Local11 * Local17); + float Local19 = math::lerp(0.0,0.5,Local12.y); + float Local20 = math::lerp(0.7,1.0,Local9.y); + float Local21 = math::lerp(Local20,1.0,0.0); + float Local22 = (Local21 * 1.0); + float Local23 = (Local19 + Local22); + float Local24 = math::min(math::max(Local23,0.0),1.0); + + float3 EmissiveColor_mdl = float3(0.0,0.0,0.0); + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = float3(Local18,Local18,Local18); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = Local24; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/model_42bfd814921da5caa11f98e41e207019_0.usda b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/model_42bfd814921da5caa11f98e41e207019_0.usda new file mode 100644 index 0000000000000000000000000000000000000000..9836eaeaa4863766663f9985e7bc24d56a4401c7 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/SubUSDs/model_42bfd814921da5caa11f98e41e207019_0.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_model_42bfd814921da5caa11f98e41e207019_0" ( + prepend payload = @./model_42bfd814921da5caa11f98e41e207019_0.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task4/scene.usda b/assets/scene_usds/ebench/simple_pnp/task4/scene.usda new file mode 100644 index 0000000000000000000000000000000000000000..8509c1a6d712cebbbdcecf66792dfdb1dee99f97 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task4/scene.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_scene" ( + prepend payload = @./scene.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task5/scene.usda b/assets/scene_usds/ebench/simple_pnp/task5/scene.usda new file mode 100644 index 0000000000000000000000000000000000000000..8509c1a6d712cebbbdcecf66792dfdb1dee99f97 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task5/scene.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_scene" ( + prepend payload = @./scene.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/DayMaterial.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/DayMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2065d8e637cf60ef12e03a73082728622aaa7044 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/DayMaterial.mdl @@ -0,0 +1,67 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material DayMaterial( + float Flat = 1.0 + [[ + anno::display_name("Flat"), + anno::ui_order(32) + ]], + uniform texture_2d img = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("img"), + anno::ui_order(32), + sampler_color() + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + + float3 Normal_mdl = float3(0.0,0.0,1.0); + + float4 Local0 = tex::lookup_float4(img,float2(CustomizedUV0_mdl.x,1.0-CustomizedUV0_mdl.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local1 = (Flat * float3(Local0.x,Local0.y,Local0.z)); + + float3 EmissiveColor_mdl = Local1; + float Opacity_mdl = Local0.w; + float OpacityMask_mdl = (math::saturate(Local0.w) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = float3(0.0,0.0,0.0); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = 0.5; + float2 Refraction_mdl = float2(float2(1.0,0.0).x,float2(1.0,0.0).x); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/KooPbr.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/KooPbr.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5e993afd51fcee2e32fb4d95cd3570aff2eb9405 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/KooPbr.mdl @@ -0,0 +1,462 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::anno::*; +import ::df::*; +import ::df::color_weighted_layer; +import ::math::*; +import ::state::*; + +export material KooMtl2Sided( + material frontMtl = material() [[ + anno::in_group("Parameters"), + anno::display_name("Front material") + ]], + material backMtl = frontMtl [[ + anno::in_group("Parameters"), + anno::display_name("Back material") + ]], + uniform bool use_backMtl = false [[ + anno::in_group("Parameters"), + anno::display_name("Use back material") + ]], + color translucency = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Basic parameters"), + anno::display_name("Translucency") + ]], + color front_tint = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Front tint"), + anno::hidden() + ]], + color back_tint = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Back tint"), + anno::hidden() + ]], + uniform bool multiply_by_front_diffuse = false [[ + anno::in_group("Basic parameters"), + anno::display_name("Multiply by front diffuse"), + anno::unused(), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + bsdf transmission_bsdf = + df::diffuse_transmission_bsdf(tint: (front_tint + back_tint)*0.5f); + + bsdf front_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : frontMtl.surface.scattering + ); + + bsdf back_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : backMtl.surface.scattering + ); + } in + material( + thin_walled: true, + ior: frontMtl.ior, + surface: material_surface(scattering: front_bsdf), + backface: material_surface(scattering: use_backMtl ? back_bsdf : front_bsdf), + volume: frontMtl.volume, + geometry: frontMtl.geometry + ); + +float emissive_multiplier() uniform +[[ + anno::description("unit conversion from pbrjson emission to mdl"), + anno::noinline() +]] +{ + return 2560.f; +} + +export material KooLightMtl( + color emission = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Emission") + ]], + uniform float emission_mult = 1.f [[ + anno::in_group("Parameters"), + anno::display_name("Mutliplier") + ]], + color opacity = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Opacity") + ]], + uniform bool emit_on_backside = false [[ + anno::in_group("Parameters"), + anno::display_name("Emit light on back side") + ]]) +[[ + anno::author("KooLab") +]] + = + let { + color emission_color = (emission*opacity)*emission_mult * emissive_multiplier(); + + bsdf surface_bsdf = + df::simple_glossy_bsdf + ( + mode: df::scatter_transmit, + tint: color(1.f) - opacity, + roughness_u: 0 + ); + + material_surface emit_surface = material_surface( + scattering: surface_bsdf, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: emission_color) + ); + } in + material( + thin_walled: emit_on_backside, + ior: color(1.f), + surface: emit_surface, + backface: emit_on_backside ? emit_surface : material_surface() + ); + +export material KooMtl( + color diffuse = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("diffuse") + ]], + color reflect = color(0.f, 0.f, 0.f) [[ + anno::in_group("Reflections"), + anno::display_name("reflect") + ]], + float reflect_glossiness = 1.f [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool fresnel = true [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float fresnel_ior = 1.6f [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::hard_range(0.2f, 5.f) + ]], + uniform bool fresnel_ior_lock = true [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refract_ior = 1.6f [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool invert_refraction_ior = false [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + color self_illumination = color(0.f, 0.f, 0.f) [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-Illumination Intensity") + ]], + float anisotropy = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + float3 texmap_bump = state::normal() [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float opacity = 1.f [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + uniform bool thin_walled = false [[ + anno::in_group("Options"), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + float reflection_roughness = math::pow((1.f - reflect_glossiness), 2.f); + + float refl_ior = invert_reflection_ior ? 1.f/(fresnel_ior + 0.01f) : fresnel_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refract_ior + 0.01f) : refract_ior; + + float ior = fresnel_ior_lock ? refr_ior : refl_ior; + float R0 = math::pow((1.f - ior)/(1.f + ior), 2.f); + + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse, + roughness : 0.0f + ), + normal : texmap_bump + ); + + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: fresnel ? reflect : color(1.f), + roughness_u: reflection_roughness + ); + + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: diffuse, + roughness_u: reflection_roughness + ); + + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : fresnel ? color(R0) : reflect, + grazing_reflectivity: fresnel ? color(1.f) : reflect, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ); + } in + material + ( + ior : color(refr_ior), + thin_walled : thin_walled, + surface : material_surface + ( + scattering : surface_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry + ( + cutout_opacity: opacity + ) + ); + +export material KooTranslucentMtl( + color diffuse = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("Diffuse") + ]], + color reflect = color(0.f, 0.f, 0.f) [[ + anno::in_group("Reflections"), + anno::display_name("Reflect") + ]], + float reflect_glossiness = 1.f [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool fresnel = true [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float fresnel_ior = 1.6f [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::soft_range(0.2, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool fresnel_ior_lock = true [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + color refract = color(0.f, 0.f, 0.f) [[ + anno::in_group("Refractions"), + anno::display_name("Refract") + ]], + float refract_glossiness = 1.f [[ + anno::in_group("Refractions"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refract_ior = 1.6f [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool invert_refraction_ior = false [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + color self_illumination = color(0.f, 0.f, 0.f) [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f [[ + anno::in_group("Self-Illumination"), + anno::display_name("Multiplier") + ]], + float anisotropy = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + float3 texmap_bump = state::normal() [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float texmap_opacity = 1.f [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + uniform bool thin_walled = false [[ + anno::in_group("Options"), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + float reflection_roughness = math::pow((1.f - reflect_glossiness), 2.f); + + float refraction_roughness = math::pow((1.f - refract_glossiness), 2.f); + + float refl_ior = invert_reflection_ior ? 1.f/(fresnel_ior + 0.01f) : fresnel_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refract_ior + 0.01f) : refract_ior; + + float ior = fresnel_ior_lock ? refr_ior : refl_ior; + float R0 = math::pow((1.f - ior)/(1.f + ior), 2.f); + + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse, + roughness : 0.f + ), + normal : texmap_bump + ); + + bsdf glossy_transmission_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: color(1.f), + roughness_u: refraction_roughness + ); + + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: fresnel ? reflect : color(1.f), + roughness_u: reflection_roughness + ); + + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: diffuse, + roughness_u: reflection_roughness + ); + + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : fresnel ? color(R0) : reflect, + grazing_reflectivity: fresnel ? color(1.f) : reflect, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : + df::color_weighted_layer + ( + weight : refract, + layer : glossy_transmission_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ), + normal : texmap_bump + ); + } in + material( + thin_walled : thin_walled, + ior : color(refr_ior), + surface : material_surface + ( + scattering : surface_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry(cutout_opacity: texmap_opacity) + ); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff402ca6000019038b6.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff402ca6000019038b6.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5eaa6115884b717c7ee86c9da1c9f0e4d275b398 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff402ca6000019038b6.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6527fff402ca6000019038b6(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,29],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.1724999994f, 0.1724999994f, 0.1724999994f), + reflect: color(0.08200000226f, 0.08200000226f, 0.08200000226f), + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.25f, 0.25f, 0.5f, 0.5f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/0b64bb09d65cf312d4529795ee4df488f541e94_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff41ea6be000148b74b.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff41ea6be000148b74b.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9851329a0a4f9c89b9a64eb2ed018eead3d9f607 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff41ea6be000148b74b.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6527fff41ea6be000148b74b(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.01180000044f, 0.01180000044f, 0.01180000044f), + reflect: color(0.2939999998f, 0.2939999998f, 0.2939999998f), + reflect_glossiness: 0.6000000238f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff429931a0001ae060c.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff429931a0001ae060c.mdl new file mode 100644 index 0000000000000000000000000000000000000000..565121a0f41522eb14b63749952af4ba246ff942 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff429931a0001ae060c.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6527fff429931a0001ae060c(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.3059000075f, 0.3059000075f, 0.3059000075f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4380e0100010b7e4b.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4380e0100010b7e4b.mdl new file mode 100644 index 0000000000000000000000000000000000000000..871019bf699b48293a1336bcb1eeaf046ed22759 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4380e0100010b7e4b.mdl @@ -0,0 +1,39 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::KooPbr_maps::NormalMap_bump; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6527fff4380e0100010b7e4b(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,7,15],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.9139999747f, 0.9139999747f, 0.9139999747f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(0.9769999981f, 0.9769999981f, 0.9769999981f), + refract_glossiness: 1.f, + refract_ior: 1.51699996f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::NormalMap_bump(KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/f02c6461c74869bdba98ca63427b51e0ec1610a_1.jpg", ::tex::gamma_linear), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f), state::normal(), 1.f, 1.f, false, false, false, 1, 0.f, 1.f), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff469ad3400017cff80.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff469ad3400017cff80.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e87590e3eb7f13bd5d22253511f68d4772f8e1b9 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff469ad3400017cff80.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_bitmap_bump; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6527fff469ad3400017cff80(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,7,15],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/e823d915e549ff43164a0f8e89a335abeb1d6c1_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.25f, 0.25f, 0.5f, 0.5f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/85337c8e0f196d0bba80cffc0e73c74c9b23f5dd_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: true, + fresnel_ior: 5.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: -0.5f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::KooPbr_bitmap_bump(1, true, false, true, false, 0.f, 0.f, 0.f, 0.25f, 0.25f, 0.5f, 0.5f, 0, texture_2d("../textures/36913828c73434e80a07cc5f2f250ec80927a5b3_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, -0.05000000075f, 1.f, false, false, false, 1.f, 1.f, 0.f), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff47a627f0001f09d90.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff47a627f0001f09d90.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8bd798c6918a03257ce13a82a4f81eb0e0393fcb --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff47a627f0001f09d90.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6527fff47a627f0001f09d90(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,29,9],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.4779999852f, 0.4779999852f, 0.4779999852f), + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.25f, 0.25f, 0.5f, 0.5f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/60137e8fd866e68021eedcef0572f72b775aad2_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.001999974f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff47ae59d0001e1cd50.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff47ae59d0001e1cd50.mdl new file mode 100644 index 0000000000000000000000000000000000000000..02dcb2a3eb7a984a50547463337abfcedd0a3b02 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff47ae59d0001e1cd50.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::anno::description; + +export material MI_6527fff47ae59d0001e1cd50(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,29],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(0.8234999776f, 0.8234999776f, 0.8234999776f), + reflect: color(0.f, 0.f, 0.f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(0.1840000004f, 0.1840000004f, 0.1840000004f), + refract_glossiness: 1.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff480db5600018a9fb9.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff480db5600018a9fb9.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6f933b8e4493992672cd096a6f89fe684153bb88 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff480db5600018a9fb9.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6527fff480db5600018a9fb9(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,29],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, -0.25f, -0.25f, 1.5f, 1.5f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/a3b69475f2e64eedb103a65465afe990eeca0de_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.2039999962f, 0.2039999962f, 0.2039999962f), + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.25f, 0.25f, 0.5f, 0.5f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/ff3f74ecdf8d7042ae52f431c1e3222a1640f06_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff48ffa490001fb1bc4.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff48ffa490001fb1bc4.mdl new file mode 100644 index 0000000000000000000000000000000000000000..41c694636aa6ffa6a89c5ae3846882b5a50d6711 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff48ffa490001fb1bc4.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_bitmap_bump; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6527fff48ffa490001fb1bc4(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.2863000035f, 0.2863000035f, 0.2863000035f), + reflect: color(0.5256999731f, 0.5256999731f, 0.5256999731f), + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, -0.5f, -0.5f, 2.f, 2.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/78d0fe3a7817d119167f9ba2efdeb3f6feb0325_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: true, + fresnel_ior: 5.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.5500000119f, + anisotropy_rotation: 0.25f, + texmap_bump: KooPbr_maps::KooPbr_bitmap_bump(1, true, false, true, false, 0.f, 0.f, 0.f, -0.5f, -0.5f, 2.f, 2.f, 0, texture_2d("../textures/05cc8c7b1a96d8f8f9c3e0b357bd0ac583d9cb7_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, -0.05000000075f, 1.f, false, false, false, 1.f, 1.f, 0.f), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4b017c50001de9d64.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4b017c50001de9d64.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d4166989fac84637c4870aabf31f164e5ac53138 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4b017c50001de9d64.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6527fff4b017c50001de9d64(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.00800000038f, 0.009999999776f, 0.009999999776f), + reflect: color(0.92900002f, 0.9750000238f, 1.f), + reflect_glossiness: 0.6000000238f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.468000054f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4b3b4180001ca0e8e.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4b3b4180001ca0e8e.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0e9e385598f94f6c47e791d341859f81347b5f0b --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4b3b4180001ca0e8e.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6527fff4b3b4180001ca0e8e(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,29],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(1.f, 1.f, 1.f), + reflect: color(0.0549999997f, 0.0549999997f, 0.0549999997f), + reflect_glossiness: 0.6999999881f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/b8df1d333f0e22b44562d12a3c948996ba19e3c_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4c405fd0001493f2e.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4c405fd0001493f2e.mdl new file mode 100644 index 0000000000000000000000000000000000000000..defe78cf007912104e601566b2f714e14e493521 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4c405fd0001493f2e.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6527fff4c405fd0001493f2e(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.003899999894f, 0.003899999894f, 0.003899999894f), + reflect: color(0.92900002f, 0.9750000238f, 1.f), + reflect_glossiness: 0.4720000029f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.468000054f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4cdccc500012e4e69.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4cdccc500012e4e69.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0889c87739d4a98c151ce51e05f7860be038c4a0 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4cdccc500012e4e69.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::anno::description; + +export material MI_6527fff4cdccc500012e4e69(*) +[[ + anno::description("{\"status\":0,\"tag\":[0],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.9139999747f, 0.9139999747f, 0.9139999747f), + reflect_glossiness: 1.f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(0.9769999981f, 0.9769999981f, 0.9769999981f), + refract_glossiness: 1.f, + refract_ior: 1.51699996f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4e2d2b80001b39210.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4e2d2b80001b39210.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6ee0195b5866a213b2366985fe2e64ac4a9e532b --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6527fff4e2d2b80001b39210.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::KooPbr_maps::NormalMap_bump; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_6527fff4e2d2b80001b39210(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,29],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, -0.25f, -0.25f, 1.5f, 1.5f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/a3b69475f2e64eedb103a65465afe990eeca0de_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.2039999962f, 0.2039999962f, 0.2039999962f), + reflect_glossiness: KooPbr_maps::KooPbr_bitmap(1, 0.25f, 0.25f, 0.5f, 0.5f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/ff3f74ecdf8d7042ae52f431c1e3222a1640f06_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::NormalMap_bump(KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/58f1287499f499bd0d55b3523fce93e2cb20b4e_1.jpg", ::tex::gamma_linear, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f), state::normal(), 1.f, 1.f, false, false, false, 1, 0.f, -0.009999999776f), + opacity: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/60bfbc42cbf0462dce419ffa93e6e4b05c270f1_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).mono, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8118f5e000180acc1.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8118f5e000180acc1.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9ecf988c5ddf36ea911dc7144c4f604214e54baf --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8118f5e000180acc1.mdl @@ -0,0 +1,32 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooTranslucentMtl; +import ::anno::description; + +export material MI_652802e8118f5e000180acc1(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,998],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooTranslucentMtl( + diffuse: color(0.4235000014f, 0.4235000014f, 0.4235000014f), + reflect: color(0.1959999949f, 0.1959999949f, 0.1959999949f), + reflect_glossiness: 1.f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract: color(0.80400002f, 0.80400002f, 0.80400002f), + refract_glossiness: 1.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + texmap_opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e869ad3400017cfff8.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e869ad3400017cfff8.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f9a2877fb2d4e47aea12a5377c7905bd851e0f55 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e869ad3400017cfff8.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_652802e869ad3400017cfff8(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,998],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.7332999706f, 0.7332999706f, 0.7332999706f), + reflect: color(0.07800000161f, 0.07800000161f, 0.07800000161f), + reflect_glossiness: 0.8999999762f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e880db5600018aa030.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e880db5600018aa030.mdl new file mode 100644 index 0000000000000000000000000000000000000000..af0c1b1e7a997e6bb4c642c10f2692b3b7c11609 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e880db5600018aa030.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_652802e880db5600018aa030(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,998],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/3567ba556b5ad98137efe2cbb572714e832289_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.1369999945f, 0.1369999945f, 0.1369999945f), + reflect_glossiness: 0.8199999928f, + fresnel: true, + fresnel_ior: 2.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8b3b4180001ca0f10.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8b3b4180001ca0f10.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1d13f115272d7cc6c95ccef2cce470bf0482be8f --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8b3b4180001ca0f10.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_652802e8b3b4180001ca0f10(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,998],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.01960000023f, 0.01960000023f, 0.01960000023f), + reflect: color(0.1180000007f, 0.1180000007f, 0.1180000007f), + reflect_glossiness: 0.8000000119f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8cdccc500012e4eee.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8cdccc500012e4eee.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e48e3f4621aedf88af7e9ebf073e06b8ab393a4d --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8cdccc500012e4eee.mdl @@ -0,0 +1,36 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_652802e8cdccc500012e4eee(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,998],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 0.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 0.f, 0, texture_2d("../textures/997c6ba15f0c951f6cad6c171b7daa0da771f7_1.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.1369999945f, 0.1369999945f, 0.1369999945f), + reflect_glossiness: 0.8199999928f, + fresnel: true, + fresnel_ior: 2.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8e2d2b80001b39293.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8e2d2b80001b39293.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9f4137a3cd0282d737300fe7e4bb5782fe288952 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_652802e8e2d2b80001b39293.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_652802e8e2d2b80001b39293(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28,998],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.01960000023f, 0.01960000023f, 0.01960000023f), + reflect: color(0.5799999833f, 0.5799999833f, 0.5799999833f), + reflect_glossiness: 0.8999999762f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0317d81a00010bf6d5.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0317d81a00010bf6d5.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f30e4ca3b196d1acc2075745c90ab1873942ada7 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0317d81a00010bf6d5.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd0317d81a00010bf6d5(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(1.f, 1.f, 1.f), + reflect: color(0.9179999828f, 0.9179999828f, 0.9179999828f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd03a9943b0001ca97a3.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd03a9943b0001ca97a3.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0f69d907866914b7172f5b5ad1b80a4fe29ccd45 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd03a9943b0001ca97a3.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd03a9943b0001ca97a3(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,14],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(1.f, 0.992200017f, 0.9804000258f), + reflect: color(0.753000021f, 0.753000021f, 0.753000021f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 2.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd03fa411a000184ef9a.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd03fa411a000184ef9a.mdl new file mode 100644 index 0000000000000000000000000000000000000000..19ecc6ba9b94d87f885028be60b652f16080e380 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd03fa411a000184ef9a.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd03fa411a000184ef9a(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.007799999788f, 0.007799999788f, 0.007799999788f), + reflect: color(0.7300000191f, 0.5299999714f, 0.3199999928f), + reflect_glossiness: 0.8000000119f, + fresnel: true, + fresnel_ior: 5.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0a55f683000151920e.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0a55f683000151920e.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f3f81260b05fb5a67dbb7d0cbef975724744099a --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0a55f683000151920e.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd0a55f683000151920e(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.007799999788f, 0.007799999788f, 0.007799999788f), + reflect: color(0.05900000036f, 0.05900000036f, 0.05900000036f), + reflect_glossiness: 0.8999999762f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0a90c49f0001be063a.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0a90c49f0001be063a.mdl new file mode 100644 index 0000000000000000000000000000000000000000..60fbc3bd0168cfad810e974c02e3261975b7a3e6 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0a90c49f0001be063a.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd0a90c49f0001be063a(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.6941000223f, 0.7882000208f, 0.7803999782f), + reflect: color(0.07999999821f, 0.07999999821f, 0.07999999821f), + reflect_glossiness: 0.8000000119f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0aa388750001542160.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0aa388750001542160.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1402b929376793e5e5c2e902f1a7c8cad18e65b1 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/MI_6576cd0aa388750001542160.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd0aa388750001542160(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.7882000208f, 0.7882000208f, 0.7372999787f), + reflect: color(0.07999999821f, 0.07999999821f, 0.07999999821f), + reflect_glossiness: 0.8000000119f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/Num58ca739e5c26a005ae14274e.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/Num58ca739e5c26a005ae14274e.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0b80774b6f8330ca11b1d10dbd77f82a6c3c5d64 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/Num58ca739e5c26a005ae14274e.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num58ca739e5c26a005ae14274e( + uniform texture_2d Normal_Tex = texture_2d("../textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/Num5be4fd21ef62e015bca9629d.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/Num5be4fd21ef62e015bca9629d.mdl new file mode 100644 index 0000000000000000000000000000000000000000..50ea4cf9419b68a3599ecae72302b377af107022 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/Num5be4fd21ef62e015bca9629d.mdl @@ -0,0 +1,307 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5be4fd21ef62e015bca9629d( + uniform texture_2d Normal_Tex = texture_2d("../textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float Opacity = 0.5 + [[ + anno::display_name("Opacity"), + anno::ui_order(32), + anno::in_group("Translucent") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + uniform float SwitchRefraction = 0.0 + [[ + anno::display_name("SwitchRefraction"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + uniform float FresnelB = 1.517 + [[ + anno::display_name("FresnelB"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + float Local89 = ((math::abs(SwitchRefraction - 1.0) > 0.01) ? (1.0) : FresnelB); + + float3 EmissiveColor_mdl = Local28; + float Opacity_mdl = Opacity; + float OpacityMask_mdl = (math::saturate(Opacity) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + float2 Refraction_mdl = float2(Local89,Local89); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/OmniUe4Base.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/OmniUe4Base.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a441fbaf28040302c7aaabfbcf14b24a85bdf643 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/OmniUe4Base.mdl @@ -0,0 +1,224 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - merge unlit template +//* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side +//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - /* flip_tangent_v */ + tangent_v * normal.y + + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Base( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + float clearcoat_weight = 0.0, + float clearcoat_roughness = 0.0, + float3 clearcoat_normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform bool is_tangent_space_normal = true, + uniform bool two_sided = false, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Base"), + anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::saturate(metallic); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_clearcoat_weight = math::saturate(clearcoat_weight); + float final_clearcoat_roughness = math::saturate(clearcoat_roughness); + float3 final_normal = math::normalize(normal); + float3 final_clearcoat_normal = math::normalize(clearcoat_normal); + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color), + normal: the_normal); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + // clearcoat layer + float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0); + float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness; + + float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ); + + + bsdf clearcoat = + df::custom_curve_layer( + base: df::weighted_layer( + layer: dielectric_metal_mix, + weight: 1.0, + normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal + ), + layer: df::microfacet_ggx_smith_bsdf( + roughness_u: clearcoat_alpha, + tint: color(1.0) + ), + normal_reflectivity: 0.04, + grazing_reflectivity: clearcoat_grazing_refl, + normal: the_clearcoat_normal, + weight: final_clearcoat_weight + ); + bsdf surface = is_unlit ? bsdf() : clearcoat; +} +in material( + thin_walled: two_sided, // Graphene? + surface: material_surface( + scattering: surface, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + backface: material_surface( + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + geometry: material_geometry( + displacement: displacement, + normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(), + cutout_opacity: enable_opacity ? opacity : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/OmniUe4Function.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/OmniUe4Function.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0801afff6f0870ea2574c9e9b6e2043e79e9a79 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/OmniUe4Function.mdl @@ -0,0 +1,1413 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.1 - using absolute import paths when importing standard modules + +mdl 1.6; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + + +export float3 convert_to_left_hand(float3 vec3, uniform bool up_z = true, uniform bool is_position = true) +[[ + anno::description("convert from RH to LH"), + anno::noinline() +]] +{ + float4x4 ZupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4x4 YupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4 vec4 = float4(vec3.x, vec3.y, vec3.z, is_position ? 1.0f : 0.0f); + + vec4 = vec4 * (up_z ? ZupConversion : YupConversion); + + return float3(vec4.x, vec4.y, vec4.z); +} + +export float3 transform_vector_from_tangent_to_world(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from tangent space to world space"), + anno::noinline() +]] +{ + /* flip_tangent_v */ + return convert_to_left_hand( + tangent_u * vector.x - tangent_v * vector.y + state::normal() * vector.z, + up_z, false); +} + +export float3 transform_vector_from_world_to_tangent(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from world space to tangent space"), + anno::noinline() +]] +{ + float3 vecRH = convert_to_left_hand(vector, up_z, false); + /* flip_tangent_v */ + return vecRH.x * float3(tangent_u.x, -tangent_v.x, state::normal().x) + + vecRH.y * float3(tangent_u.y, -tangent_v.y, state::normal().y) + + vecRH.z * float3(tangent_u.z, -tangent_v.z, state::normal().z); +} + +export float4 unpack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Unpack a normal stored in a normal map"), + anno::noinline() +]] +{ + float2 normal_xy = float2(texture_sample.x, texture_sample.y); + + normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0); + float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) ); + return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 ); +} + +// for get color value from normal. +export float4 pack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Pack to color from a normal") +]] +{ + float2 return_xy = float2(texture_sample.x, texture_sample.y); + + return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0); + + return float4( return_xy.x, return_xy.y, 0.0, 1.0 ); +} + +export float4 greyscale_texture_lookup( + float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0) + ) +[[ + anno::description("Sampling a greyscale texture"), + anno::noinline() +]] +{ + return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x); +} + +export float3 pixel_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Pixel normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 vertex_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Vertex normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 landscape_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Landscape normal in world space") +]] +{ + float3 normalFromNormalmap = math::floor((::vertex_normal_world_space(up_z) * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0; + + float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y); + return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY)))); +} + +// Different implementation specific between mdl and hlsl for smoothstep +export float smoothstep(float a, float b, float l) +{ + if (a < b) + { + return math::smoothstep(a, b, l); + } + else if (a > b) + { + return 1.0 - math::smoothstep(b, a, l); + } + else + { + return l <= a ? 0.0 : 1.0; + } +} + +export float2 smoothstep(float2 a, float2 b, float2 l) +{ + return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y)); +} + +export float3 smoothstep(float3 a, float3 b, float3 l) +{ + return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z)); +} + +export float4 smoothstep(float4 a, float4 b, float4 l) +{ + return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w)); +} + +export float2 smoothstep(float2 a, float2 b, float l) +{ + return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l)); +} + +export float3 smoothstep(float3 a, float3 b, float l) +{ + return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l)); +} + +export float4 smoothstep(float4 a, float4 b, float l) +{ + return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l)); +} + +export float2 smoothstep(float a, float b, float2 l) +{ + return float2(smoothstep(a, b, l.x), smoothstep(a, b, l.y)); +} + +export float3 smoothstep(float a, float b, float3 l) +{ + return float3(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z)); +} + +export float4 smoothstep(float a, float b, float4 l) +{ + return float4(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z), smoothstep(a, b, l.w)); +} + +//------------------ Random from UE4 ----------------------- +float length2(float3 v) +{ + return math::dot(v, v); +} + +float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v) +{ + const float2 ZShear = float2(17.0f, 89.0f); + + float2 OffsetA = v.z * ZShear; + float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f; + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat); + return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0; +} + +float3 SkewSimplex(float3 In) +{ + return In + math::dot(In, float3(1.0 / 3.0f) ); +} +float3 UnSkewSimplex(float3 In) +{ + return In - math::dot(In, float3(1.0 / 6.0f) ); +} + +// 3D random number generator inspired by PCGs (permuted congruential generator) +// Using a **simple** Feistel cipher in place of the usual xor shift permutation step +// @param v = 3D integer coordinate +// @return three elements w/ 16 random bits each (0-0xffff). +// ~8 ALU operations for result.x (7 mad, 1 >>) +// ~10 ALU operations for result.xy (8 mad, 2 >>) +// ~12 ALU operations for result.xyz (9 mad, 3 >>) + +//TODO: uint3 +int3 Rand3DPCG16(int3 p) +{ + // taking a signed int then reinterpreting as unsigned gives good behavior for negatives + //TODO: uint3 + int3 v = int3(p); + + // Linear congruential step. These LCG constants are from Numerical Recipies + // For additional #'s, PCG would do multiple LCG steps and scramble each on output + // So v here is the RNG state + v = v * 1664525 + 1013904223; + + // PCG uses xorshift for the final shuffle, but it is expensive (and cheap + // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps + // + // Feistel ciphers divide the state into separate parts (usually by bits) + // then apply a series of permutation steps one part at a time. The permutations + // use a reversible operation (usually ^) to part being updated with the result of + // a permutation function on the other parts and the key. + // + // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for + // the combination function, and just multiplying the other two parts (no key) for + // the permutation function. + // + // That gives a simple mad per round. + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + + // only top 16 bits are well shuffled + return v >> 16; +} + +// Wraps noise for tiling texture creation +// @param v = unwrapped texture parameter +// @param bTiling = true to tile, false to not tile +// @param RepeatSize = number of units before repeating +// @return either original or wrapped coord +float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize) +{ + return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v; +} + +// Evaluate polynomial to get smooth transitions for Perlin noise +// only needed by Perlin functions in this file +// scalar(per component): 2 add, 5 mul +float4 PerlinRamp(float4 t) +{ + return t * t * t * (t * (t * 6 - 15) + 10); +} + +// Blum-Blum-Shub-inspired pseudo random number generator +// http://www.umbc.edu/~olano/papers/mNoise.pdf +// real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes +// instead, we use a single prime M just small enough not to overflow +// note that the above paper used 61, which fits in a half, but is unusably bad +// @param Integer valued floating point seed +// @return random number in range [0,1) +// ~8 ALU operations (5 *, 3 frac) +float RandBBSfloat(float seed) +{ + float BBS_PRIME24 = 4093.0; + float s = math::frac(seed / BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + return s; +} + +// Modified noise gradient term +// @param seed - random seed for integer lattice position +// @param offset - [-1,1] offset of evaluation point from lattice point +// @return gradient direction (xyz) and contribution (w) from this lattice point +float4 MGradient(int seed, float3 offset) +{ + //TODO uint + int rand = Rand3DPCG16(int3(seed,0,0)).x; + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000); + float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1; + return float4(direction.x, direction.y, direction.z, math::dot(direction, offset)); +} + +// compute Perlin and related noise corner seed values +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = true to return seed values for a repeating noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @param seed000-seed111 = hash function seeds for the eight corners +// @return fractional part of v +struct SeedValue +{ + float3 fv = float3(0); + float seed000 = 0; + float seed001 = 0; + float seed010 = 0; + float seed011 = 0; + float seed100 = 0; + float seed101 = 0; + float seed110 = 0; + float seed111 = 0; +}; + +SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds; + seeds.fv = math::frac(v); + float3 iv = math::floor(v); + + const float3 primes = float3(19, 47, 101); + + if (bTiling) + { // can't algebraically combine with primes + seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize)); + seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize)); + seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize)); + seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize)); + seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize)); + seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize)); + seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize)); + seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize)); + } + else + { // get to combine offsets with multiplication by primes in this case + seeds.seed000 = math::dot(iv, primes); + seeds.seed100 = seeds.seed000 + primes.x; + seeds.seed010 = seeds.seed000 + primes.y; + seeds.seed110 = seeds.seed100 + primes.y; + seeds.seed001 = seeds.seed000 + primes.z; + seeds.seed101 = seeds.seed100 + primes.z; + seeds.seed011 = seeds.seed010 + primes.z; + seeds.seed111 = seeds.seed110 + primes.z; + } + + return seeds; +} + +struct SimplexWeights +{ + float4 Result = float4(0); + float3 PosA = float3(0); + float3 PosB = float3(0); + float3 PosC = float3(0); + float3 PosD = float3(0); +}; + +// Computed weights and sample positions for simplex interpolation +// @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d +SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos) +{ + SimplexWeights weights; + float3 OrthogonalPosFloor = math::floor(OrthogonalPos); + + weights.PosA = OrthogonalPosFloor; + weights.PosB = weights.PosA + float3(1, 1, 1); + + OrthogonalPos -= OrthogonalPosFloor; + + float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z)); + float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z)); + + weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z); + weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z); + + float RG = OrthogonalPos.x - OrthogonalPos.y; + float RB = OrthogonalPos.x - OrthogonalPos.z; + float GB = OrthogonalPos.y - OrthogonalPos.z; + + weights.Result.z = + math::min(math::max(0, RG), math::max(0, RB)) // X + + math::min(math::max(0, -RG), math::max(0, GB)) // Y + + math::min(math::max(0, -RB), math::max(0, -GB)); // Z + + weights.Result.w = + math::min(math::max(0, -RG), math::max(0, -RB)) // X + + math::min(math::max(0, RG), math::max(0, -GB)) // Y + + math::min(math::max(0, RB), math::max(0, GB)); // Z + + weights.Result.y = Smallest; + weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w; + + return weights; +} + +// filtered 3D gradient simple noise (few texture lookups, high quality) +// @param v >0 +// @return random number in the range -1 .. 1 +float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos) +{ + float3 OrthogonalPos = SkewSimplex(EvalPos); + + SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos); + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit) + float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA); + float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB); + float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC); + float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD); + + Weights.PosA = UnSkewSimplex(Weights.PosA); + Weights.PosB = UnSkewSimplex(Weights.PosB); + Weights.PosC = UnSkewSimplex(Weights.PosC); + Weights.PosD = UnSkewSimplex(Weights.PosD); + + float DistanceWeight; + + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight; + + return 32 * (a + b + c + d); +} + +// filtered 3D noise, can be optimized +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize) +{ + bTiling = true; + float3 fv = math::frac(v); + float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize); + float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize); + + const int2 ZShear = int2(17, 89); + + float2 OffsetA = iv0.z * ZShear; + float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset + if (bTiling) // tiling, have to compute from wrapped coordinates + { + OffsetB = iv1.z * ZShear; + } + + // Texture size scale factor + float ts = 1 / 128.0f; + + // texture coordinates for iv0.xy, as offset for both z slices + float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts; + float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts; + + // texture coordinates for iv1.xy, as offset for both z slices + float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates + float2 TexB1 = TexB0 + ts; + if (bTiling) // for tiling, need to compute from wrapped coordinates + { + TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts; + TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts; + } + + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit) + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 A = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 B = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 C = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 D = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 E = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 F = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 G = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 H = PerlinNoiseColor * 2 - 1; + + float a = math::dot(A, fv - float3(0, 0, 0)); + float b = math::dot(B, fv - float3(1, 0, 0)); + float c = math::dot(C, fv - float3(0, 1, 0)); + float d = math::dot(D, fv - float3(1, 1, 0)); + float e = math::dot(E, fv - float3(0, 0, 1)); + float f = math::dot(F, fv - float3(1, 0, 1)); + float g = math::dot(G, fv - float3(0, 1, 1)); + float h = math::dot(H, fv - float3(1, 1, 1)); + + float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0))); + + float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y); + float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y); + + return math::lerp(i, j, Weights.z); +} + +// @return random number in the range -1 .. 1 +// scalar: 6 frac, 31 mul/mad, 15 add, +float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz) +{ + // needs to be the same value when creating the PerlinNoise3D texture + float Extent = 16; + + // last texel replicated and needed for filtering + // scalar: 3 frac, 6 mul + xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1); + + // scalar: 3 frac + float3 uvw = math::frac(xyz); + // = floor(xyz); + // scalar: 3 add + float3 p0 = xyz - uvw; +// float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping) + // scalar: 2*3 add 5*3 mul + float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0)); + float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping + // scalar: 3 add + float3 p = p0 + f; + // scalar: 3 mad + // TODO: need reverse??? + float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset + + // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count) + // scalar: 4 mad, 3 mul, 3 add + float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f; + float d = NoiseSample.w * 255.f - 127; + return math::dot(xyz, n) - d; +} + +// Perlin-style "Modified Noise" +// http://www.umbc.edu/~olano/papers/index.html#mNoise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w; + float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w; + float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w; + float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w; + float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w; + float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w; + float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w; + float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D value noise - used to be incorrectly called Perlin noise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1; + float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1; + float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1; + float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1; + float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1; + float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1; + float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1; + float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D jitter offset within a voronoi noise cell +// @param pos - integer lattice corner +// @return random offsets vector +float3 VoronoiCornerSample(float3 pos, int Quality) +{ + // random values in [-0.5, 0.5] + float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5; + + // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 2x2x2 search + if (Quality <= 2) + { + return math::normalize(noise) * 0.2588; + } + + // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 3x3x3 search + if (Quality == 3) + { + return math::normalize(noise) * 0.3090; + } + + // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search + return noise; +} + +// compare previous best with a new candidate +// not producing point locations makes it easier for compiler to eliminate calculations when they're not needed +// @param minval = location and distance of best candidate seed point before the new one +// @param candidate = candidate seed point +// @param offset = 3D offset to new candidate seed point +// @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position +// @return position (if bDistanceOnly is false) and distance to closest seed point so far +float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly) +{ + if (bDistanceOnly) + { + return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset))); + } + else + { + float newdist = math::dot(offset, offset); + return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist); + } +} + +// 220 instruction Worley noise +float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly) +{ + float3 fv = math::frac(v), fv2 = math::frac(v + 0.5); + float3 iv = math::floor(v), iv2 = math::floor(v + 0.5); + + // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away + float4 mindist = float4(0,0,0,100); + float3 p, offset; + + // quality level 3: do a 3x3x3 search + if (Quality == 3) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 1; ++offset_x) + { + for (offset_y = -1; offset_y <= 1; ++offset_y) + { + for (offset_z = -1; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + + // everybody else searches a base 2x2x2 neighborhood + else + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = 0; offset_x <= 1; ++offset_x) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // quality level 2, do extra set of points, offset by half a cell + if (Quality == 2) + { + // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + } + + // quality level 4: add extra sets of four cells in each direction + if (Quality >= 4) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 2; offset_x += 3) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + // along x axis + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along y axis + p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along z axis + p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + } + } + } + } + + // transform squared distance to real distance + return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w)); +} + +// Coordinates for corners of a Simplex tetrahedron +// Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011 +// @param v = 3D noise argument +// @return 4 corner locations +float4x3 SimplexCorners(float3 v) +{ + // find base corner by skewing to tetrahedral space and back + float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3); + float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6; + float3 f = v - base; + + // Find offsets to other corners (McEwan did this in tetrahedral space, + // but since skew is along x=y=z axis, this works in Euclidean space too.) + float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y); + float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0; + + // four corners + return float4x3(base, base + a1, base + a2, base + 0.5); +} + +// Improved smoothing function for simplex noise +// @param f = fractional distance to four tetrahedral corners +// @return weight for each corner +float4 SimplexSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale))); +} + +// Derivative of simplex noise smoothing function +// @param f = fractional distanc eto four tetrahedral corners +// @return derivative of smoothing function for each corner by x, y and z +float3x4 SimplexDSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + s = -12 * scale + s*(24 * scale - s * 12 * scale); + + return float3x4( + s * float4(f[0][0], f[1][0], f[2][0], f[3][0]), + s * float4(f[0][1], f[1][1], f[2][1], f[3][1]), + s * float4(f[0][2], f[1][2], f[2][2], f[3][2])); +} + +// Simplex noise and its Jacobian derivative +// @param v = 3D noise argument +// @param bTiling = whether to repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3 +// @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w +// J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz) +// J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx +// You can use this to compute the noise, gradient, curl, or divergence: +// float3x4 J = JacobianSimplex_ALU(...); +// float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise +// float3 Grad = J[0].xyz; // gradient of J[0].w +// float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]); +// float Div = J[0][0]+J[1][1]+J[2][2]; +// All of these are confirmed to compile out all unneeded terms. +// So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation. +float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize) +{ + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000); + + // corners of tetrahedron + float4x3 T = SimplexCorners(v); + // TODO: uint3 + int3 rand = int3(0); + float4x3 gvec0 = float4x3(1.0); + float4x3 gvec1 = float4x3(1.0); + float4x3 gvec2 = float4x3(1.0); + float4x3 fv = float4x3(1.0); + float3x4 grad = float3x4(1.0); + + // processing of tetrahedral vertices, unrolled + // to compute gradient at each corner + fv[0] = v - T[0]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize)))); + gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][0] = math::dot(gvec0[0], fv[0]); + grad[1][0] = math::dot(gvec1[0], fv[0]); + grad[2][0] = math::dot(gvec2[0], fv[0]); + + fv[1] = v - T[1]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize)))); + gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][1] = math::dot(gvec0[1], fv[1]); + grad[1][1] = math::dot(gvec1[1], fv[1]); + grad[2][1] = math::dot(gvec2[1], fv[1]); + + fv[2] = v - T[2]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize)))); + gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][2] = math::dot(gvec0[2], fv[2]); + grad[1][2] = math::dot(gvec1[2], fv[2]); + grad[2][2] = math::dot(gvec2[2], fv[2]); + + fv[3] = v - T[3]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize)))); + gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][3] = math::dot(gvec0[3], fv[3]); + grad[1][3] = math::dot(gvec1[3], fv[3]); + grad[2][3] = math::dot(gvec2[3], fv[3]); + + // blend gradients + float4 sv = SimplexSmooth(fv); + float3x4 ds = SimplexDSmooth(fv); + + float3x4 jacobian = float3x4(1.0); + float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major) + jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0])); + float3 vec1 = gvec1*sv + grad[1]*ds; + jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1])); + float3 vec2 = gvec2*sv + grad[2]*ds; + jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2])); + + return jacobian; +} + +// While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes +// floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion. +float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize) +{ + // verified, HLSL compiled out the switch if Function is a constant + switch(Function) + { + case 0: + return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position); + case 1: + return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize); + case 2: + return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position); + case 3: + return GradientNoise3D_ALU(Position, bTiling, RepeatSize); + case 4: + return ValueNoise3D_ALU(Position, bTiling, RepeatSize); + case 5: + return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0; + } + return 0; +} +//---------------------------------------------------------- + +export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize) +[[ + anno::description("Noise"), + anno::noinline() +]] +{ + Position *= Scale; + FilterWidth *= Scale; + + float Out = 0.0f; + float OutScale = 1.0f; + float InvLevelScale = 1.0f / LevelScale; + + int iFunction(Function); + int iQuality(Quality); + int iLevels(Levels); + bool bTurbulence(Turbulence); + bool bTiling(Tiling); + + for(int i = 0; i < iLevels; ++i) + { + // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions) + OutScale *= math::saturate(1.0 - FilterWidth); + + if(bTurbulence) + { + Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale; + } + else + { + Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale; + } + + Position *= LevelScale; + RepeatSize *= LevelScale; + OutScale *= InvLevelScale; + FilterWidth *= LevelScale; + } + + if(!bTurbulence) + { + // bring -1..1 to 0..1 range + Out = Out * 0.5f + 0.5f; + } + + // Out is in 0..1 range + return math::lerp(OutputMin, OutputMax, Out); +} + +// Material node for noise functions returning a vector value +// @param LevelScale usually 2 but higher values allow efficient use of few levels +// @return in user defined range (OutputMin..OutputMax) +export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise"), + anno::noinline() +]] +{ + float4 result = float4(0,0,0,1); + float3 ret = float3(0); + int iQuality = int(Quality); + int iFunction = int(Function); + bool bTiling = Tiling > 0.0; + + float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used + + // verified, HLSL compiled out the switch if Function is a constant + switch (iFunction) + { + case 0: // Cellnoise + ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff; + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 1: // Color noise + ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 2: // Gradient + result = Jacobian[0]; + break; + case 3: // Curl + ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 4: // Voronoi + result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false); + break; + } + return result; +} + +export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise float3 version"), + anno::noinline() +]] +{ + float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize); + return float3(noise.x, noise.y, noise.z); +} + + +// workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view +export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]]) +[[ + anno::description("Fresnel"), + anno::noinline() +]] +{ + return 0.0; +} + +export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]], + bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]], + bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]], + bool clamp_fresnel_dot_product [[anno::unused()]]) +[[ + anno::description("Fresnel Function"), + anno::noinline() +]] +{ + return 0.0; +} + +export float3 camera_vector(uniform bool up_z = true) +[[ + anno::description("Camera Vector"), + anno::noinline() +]] +{ + // assume camera postion is 0,0,0 + return math::normalize(float3(0) - convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)); +} + +export float pixel_depth() +[[ + anno::description("Pixel Depth"), + anno::noinline() +]] +{ + return 256.0f; +} + +export float scene_depth() +[[ + anno::description("Scene Depth") +]] +{ + return 65500.0f; +} + +export float3 scene_color() +[[ + anno::description("Scene Color") +]] +{ + return float3(1.0f); +} + +export float4 vertex_color() +[[ + anno::description("Vertex Color"), + anno::noinline() +]] +{ + return float4(1.0f); +} + +export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex) +[[ + anno::description("Vertex Color for float2 PrimVar"), + anno::noinline() +]] +{ + // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead + return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y); +} + +export float3 camera_position() +[[ + anno::description("Camera Position"), + anno::noinline() +]] +{ + return float3(1000.0f, 0, 0); +} + +export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position) +[[ + anno::description("Rotates Position about the given axis by the given angle") +]] +{ + // Project Position onto the rotation axis and find the closest point on the axis to Position + float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z); + float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis); + // Construct orthogonal axes in the plane of the rotation + float3 UAxis = Position - ClosestPointOnAxis; + float3 VAxis = math::cross(NormalizedRotationAxis, UAxis); + float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w); + // Rotate using the orthogonal axes + float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0]; + // Reconstruct the rotated world space position + float3 RotatedPosition = ClosestPointOnAxis + R; + // Convert from position to a position offset + return RotatedPosition - Position; +} + +export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset) +[[ + anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied") +]] +{ + return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset; +} + +export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal, uniform bool up_z = true) +[[ + anno::description("Reflection vector about the specified world space normal") +]] +{ + if (bNormalizeInputNormal) + { + WorldNormal = math::normalize(WorldNormal); + } + + return -camera_vector(up_z) + WorldNormal * math::dot(WorldNormal, camera_vector(up_z)) * 2.0; +} + +export float3 reflection_vector(uniform bool up_z = true) +[[ + anno::description("Reflection Vector"), + anno::noinline() +]] +{ + float3 normal = convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); + return reflection_custom_world_normal(normal, false, up_z); +} + +export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]]) +[[ + anno::description("Dither TemporalAA"), + anno::noinline() +]] +{ + return AlphaThreshold; +} + +export float3 black_body( float Temp ) +[[ + anno::description("Black Body"), + anno::noinline() +]] +{ + float u = ( 0.860117757f + 1.54118254e-4f * Temp + 1.28641212e-7f * Temp*Temp ) / ( 1.0f + 8.42420235e-4f * Temp + 7.08145163e-7f * Temp*Temp ); + float v = ( 0.317398726f + 4.22806245e-5f * Temp + 4.20481691e-8f * Temp*Temp ) / ( 1.0f - 2.89741816e-5f * Temp + 1.61456053e-7f * Temp*Temp ); + + float x = 3*u / ( 2*u - 8*v + 4 ); + float y = 2*v / ( 2*u - 8*v + 4 ); + float z = 1 - x - y; + + float Y = 1; + float X = Y/y * x; + float Z = Y/y * z; + + float3x3 XYZtoRGB = float3x3( + float3(3.2404542, -1.5371385, -0.4985314), + float3(-0.9692660, 1.8760108, 0.0415560), + float3(0.0556434, -0.2040259, 1.0572252) + ); + + return XYZtoRGB * float3( X, Y, Z ) * math::pow( 0.0004 * Temp, 4 ); +} + +export float per_instance_random(uniform texture_2d PerlinNoiseGradientTexture, int NumberInstances) +[[ + anno::description("Per Instance Random"), + anno::noinline() +]] +{ + float weight = state::object_id() / float(NumberInstances); + return NumberInstances == 0 ? 0.0 : tex::lookup_float4(PerlinNoiseGradientTexture, float2(weight, 1.0 - weight), tex::wrap_repeat, tex::wrap_repeat).x; +} + +//------------------ Hair from UE4 ----------------------- +float3 hair_absorption_to_color(float3 A) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::exp(-math::sqrt(A) * D); +} + +float3 hair_color_to_absorption(float3 C) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::pow(math::log(C) / D, 2.0f); +} + +export float3 get_hair_color_from_melanin(float InMelanin, float InRedness, float3 InDyeColor) +[[ + anno::description("Hair Color") +]] +{ + InMelanin = math::saturate(InMelanin); + InRedness = math::saturate(InRedness); + float Melanin = -math::log(math::max(1 - InMelanin, 0.0001f)); + float Eumelanin = Melanin * (1 - InRedness); + float Pheomelanin = Melanin * InRedness; + + float3 DyeAbsorption = hair_color_to_absorption(math::saturate(InDyeColor)); + float3 Absorption = Eumelanin * float3(0.506f, 0.841f, 1.653f) + Pheomelanin * float3(0.343f, 0.733f, 1.924f); + + return hair_absorption_to_color(Absorption + DyeAbsorption); +} + +export float3 local_object_bounds_min() +[[ + anno::description("Local Object Bounds Min"), + anno::noinline() +]] +{ + return float3(0.0); +} + +export float3 local_object_bounds_max() +[[ + anno::description("Local Object Bounds Max"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float3 object_bounds() +[[ + anno::description("Object Bounds"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float object_radius() +[[ + anno::description("Object Radius"), + anno::noinline() +]] +{ + return 100.0f; +} + +export float3 object_world_position(uniform bool up_z = true) +[[ + anno::description("Object World Position"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)*state::meters_per_scene_unit()*100.0; +} + +export float3 object_orientation() +[[ + anno::description("Object Orientation"), + anno::noinline() +]] +{ + return float3(0); +} + +export float rcp(float x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float2 rcp(float2 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float3 rcp(float3 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float4 rcp(float4 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export int BitFieldExtractI32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractI32 int"), + anno::noinline() +]] +{ + Size &= 3; + Offset &= 3; + + if (Size == 0) + return 0; + else if (Offset + Size < 32) + return (Data << (32 - Size - Offset)) >> (32 - Size); + else + return Data >> Offset; +} + +export int BitFieldExtractI32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractI32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(int(Data), int(Size), int(Offset)); +} + +export int BitFieldExtractU32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractU32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export int BitFieldExtractU32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractU32 int"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export float3 EyeAdaptationInverseLookup(float3 LightValue, float Alpha) +[[ + anno::description("EyeAdaptationInverseLookup"), + anno::noinline() +]] +{ + float Adaptation = 1.0f; + + // When Alpha=0.0, we want to multiply by 1.0. when Alpha = 1.0, we want to multiply by 1/Adaptation. + // So the lerped value is: + // LerpLogScale = Lerp(log(1),log(1/Adaptaiton),T) + // Which is simplified as: + // LerpLogScale = Lerp(0,-log(Adaptation),T) + // LerpLogScale = -T * logAdaptation; + + float LerpLogScale = -Alpha * math::log(Adaptation); + float Scale = math::exp(LerpLogScale); + return LightValue * Scale; +} diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/OmniUe4Translucent.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/OmniUe4Translucent.mdl new file mode 100644 index 0000000000000000000000000000000000000000..483a83004b8f7d5bf820a7905d06ea2d7d5894af --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/OmniUe4Translucent.mdl @@ -0,0 +1,233 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - Emissive color affected by opacity +// - Support opacity mask +//* 1.0.2 - Unlit translucent +//* 1.0.3 - specular bsdf instead of microfacet ggx smith bsdf +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +color get_translucent_tint(color base_color, float opacity) +[[ + anno::description("base color of UE4 translucent"), + anno::noinline() +]] +{ + return math::lerp(color(1.0), base_color, opacity); +} + +// Just for UE4 distilling +float get_translucent_opacity(float opacity) +[[ + anno::noinline() +]] +{ + return opacity; +} + +color get_emissive_intensity(color emissive, float opacity) +[[ + anno::description("emissive color of UE4 translucent"), + anno::noinline() +]] +{ + return emissive * opacity; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - + tangent_v * normal.y + /* flip_tangent_v */ + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Translucent( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float opacity_mask = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform float refraction = 1.0, + uniform bool two_sided = false, + uniform bool is_tangent_space_normal = true, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Translucent"), + anno::description("Omni UE4 Translucent, supports UE4 Translucent shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "translucent")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::min(math::max(metallic, 0.0f), 0.99f); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_opacity = math::saturate(opacity); + float3 final_normal = math::normalize(normal); + + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color)); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + bsdf frosted_bsdf = df::specular_bsdf( + tint: color(1), + mode: df::scatter_reflect_transmit + ); + + bsdf final_mix_bsdf = + is_unlit ? df::specular_bsdf( + tint: get_translucent_tint(base_color: final_base_color, opacity: final_opacity), + mode: df::scatter_reflect_transmit + ) + : df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: dielectric_metal_mix, + weight: get_translucent_opacity(final_opacity)), + df::bsdf_component( + component: frosted_bsdf, + weight: 1.0-get_translucent_opacity(final_opacity)) + ) + ); +} +in material( + thin_walled: two_sided, // Graphene? + ior: color(refraction), //refraction + surface: material_surface( + scattering: final_mix_bsdf, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: get_emissive_intensity(emissive: final_emissive_color, opacity: final_opacity) + ) + ), + + geometry: material_geometry( + displacement: displacement, + normal: the_normal, + cutout_opacity: enable_opacity ? opacity_mask : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/WorldGridMaterial.mdl b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/WorldGridMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8040029cab1073713e0c535664dd57ed7f6b5522 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/SubUSDs/materials/WorldGridMaterial.mdl @@ -0,0 +1,75 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material WorldGridMaterial( + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (CustomizedUV0_mdl / 2.0); + float2 Local1 = (Local0 / 0.05); + float4 Local2 = ::unpack_normal_map(tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_N.png",::tex::gamma_linear),float2(Local1.x,1.0-Local1.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local3 = (float3(Local2.x,Local2.y,Local2.z) * float3(0.3,0.3,1.0)); + + float3 Normal_mdl = Local3; + + float2 Local4 = (CustomizedUV0_mdl * 20.0); + float4 Local5 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat); + float Local6 = math::lerp(0.4,1.0,Local5.x); + float Local7 = (1.0 - Local6); + float2 Local8 = (Local0 / 0.1); + float4 Local9 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local8.x,1.0-Local8.y),tex::wrap_repeat,tex::wrap_repeat); + float Local10 = math::lerp(Local9.y,1.0,0.0); + float Local11 = math::lerp(Local6,Local7,Local10); + float4 Local12 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat); + float Local13 = math::lerp(Local9.y,0.0,0.0); + float Local14 = (Local12.y + Local13); + float Local15 = math::lerp(Local14,0.5,0.5); + float Local16 = math::lerp(0.295,0.66,Local15); + float Local17 = (Local16 * 0.5); + float Local18 = (Local11 * Local17); + float Local19 = math::lerp(0.0,0.5,Local12.y); + float Local20 = math::lerp(0.7,1.0,Local9.y); + float Local21 = math::lerp(Local20,1.0,0.0); + float Local22 = (Local21 * 1.0); + float Local23 = (Local19 + Local22); + float Local24 = math::min(math::max(Local23,0.0),1.0); + + float3 EmissiveColor_mdl = float3(0.0,0.0,0.0); + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = float3(Local18,Local18,Local18); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = Local24; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/simple_pnp/task6/scene.usda b/assets/scene_usds/ebench/simple_pnp/task6/scene.usda new file mode 100644 index 0000000000000000000000000000000000000000..8509c1a6d712cebbbdcecf66792dfdb1dee99f97 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task6/scene.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_scene" ( + prepend payload = @./scene.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task7/scene.usda b/assets/scene_usds/ebench/simple_pnp/task7/scene.usda new file mode 100644 index 0000000000000000000000000000000000000000..8509c1a6d712cebbbdcecf66792dfdb1dee99f97 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task7/scene.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_scene" ( + prepend payload = @./scene.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task8/scene.usda b/assets/scene_usds/ebench/simple_pnp/task8/scene.usda new file mode 100644 index 0000000000000000000000000000000000000000..8509c1a6d712cebbbdcecf66792dfdb1dee99f97 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task8/scene.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_scene" ( + prepend payload = @./scene.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/0.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/0.usda new file mode 100644 index 0000000000000000000000000000000000000000..9f5f5b60d67e98e22e1625d3648ef483e87284e5 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/0.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_0" ( + prepend payload = @./0.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/1.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/1.usda new file mode 100644 index 0000000000000000000000000000000000000000..8510577eccc1abcb351ec7258d76d1628f076dda --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/1.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_1" ( + prepend payload = @./1.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/2.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/2.usda new file mode 100644 index 0000000000000000000000000000000000000000..e9c73ec7e466c3704cb0566c852d44d8581df9e3 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/2.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_2" ( + prepend payload = @./2.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/6.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/6.usda new file mode 100644 index 0000000000000000000000000000000000000000..6cca4d35491fd865c366196ace0359c9b2163acd --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/6.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_6" ( + prepend payload = @./6.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_1.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_1.usda new file mode 100644 index 0000000000000000000000000000000000000000..2aa07500e81774cbfad39ef268d50e243a1c60a7 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_1.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_1" ( + prepend payload = @./instance_1.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_10.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_10.usda new file mode 100644 index 0000000000000000000000000000000000000000..0eda4370a360df02ed6faaa0b81b57871b3daeb0 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_10.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_10" ( + prepend payload = @./instance_10.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_106.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_106.usd new file mode 100644 index 0000000000000000000000000000000000000000..45e62295c75773330bec94b161b1d8cc8469aaf7 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_106.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_107.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_107.usd new file mode 100644 index 0000000000000000000000000000000000000000..9f12045c66875522f8b88935feddf140fac46e83 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_107.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_110.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_110.usd new file mode 100644 index 0000000000000000000000000000000000000000..84bd0e334fdff8d086afd145b93a4affdf0f094b Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_110.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_113.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_113.usda new file mode 100644 index 0000000000000000000000000000000000000000..91969e31a598267ec5638891ed402a73187ec32a --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_113.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_113" ( + prepend payload = @./instance_113.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_115.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_115.usda new file mode 100644 index 0000000000000000000000000000000000000000..72105aae91028df23285a157392385f95623932b --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_115.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_115" ( + prepend payload = @./instance_115.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_12.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_12.usd new file mode 100644 index 0000000000000000000000000000000000000000..634717faee74d3cce142b17a0d2632d5b9340db1 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_12.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_15.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_15.usd new file mode 100644 index 0000000000000000000000000000000000000000..de55c8b422be9a96c2335ad2433021de40e0f583 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_15.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_19.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_19.usda new file mode 100644 index 0000000000000000000000000000000000000000..ed0680e6e24cd4e0adddf6b68b3a785ad29fcbdc --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_19.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_19" ( + prepend payload = @./instance_19.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_2.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_2.usd new file mode 100644 index 0000000000000000000000000000000000000000..a32557cefd1b031cf0b219b0bfaaa97b04875a09 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_2.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_20.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_20.usda new file mode 100644 index 0000000000000000000000000000000000000000..2265e292cad808ee50a6941bd474d8d2e11ceda7 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_20.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_20" ( + prepend payload = @./instance_20.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_23.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_23.usd new file mode 100644 index 0000000000000000000000000000000000000000..96c32ac435f9442bc767fd96959450dd3d540c07 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_23.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_26.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_26.usd new file mode 100644 index 0000000000000000000000000000000000000000..392ad2a89a46aba6838be92217c448989108b0ad Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_26.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_27.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_27.usd new file mode 100644 index 0000000000000000000000000000000000000000..a03f5f7249d3fc3675650e8cadc4e467a2695510 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_27.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_29.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_29.usda new file mode 100644 index 0000000000000000000000000000000000000000..3469fa5a2bb97708c17f035261096c23fc6b8108 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_29.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_29" ( + prepend payload = @./instance_29.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_32.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_32.usda new file mode 100644 index 0000000000000000000000000000000000000000..872f972c9effd7df2bc0c66391ebdde622e04ba8 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_32.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_32" ( + prepend payload = @./instance_32.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_33.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_33.usd new file mode 100644 index 0000000000000000000000000000000000000000..fbd3ba87520cb1c365428a3d805f271f1d426439 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_33.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_33.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_33.usda new file mode 100644 index 0000000000000000000000000000000000000000..a9a6441c1d52f42197b85ce0224844e06f2408e1 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_33.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_33" ( + prepend payload = @./instance_33.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_36.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_36.usda new file mode 100644 index 0000000000000000000000000000000000000000..37b3bf3bfbb6ff312c6266b735e245988af45198 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_36.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_36" ( + prepend payload = @./instance_36.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_4.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_4.usda new file mode 100644 index 0000000000000000000000000000000000000000..00fd7c0bdc0f1f528fc2f66b58b712d761a45336 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_4.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_4" ( + prepend payload = @./instance_4.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_41.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_41.usd new file mode 100644 index 0000000000000000000000000000000000000000..c97b10b78ccbb6b1d28498e8117aad52903b2ab7 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_41.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_41.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_41.usda new file mode 100644 index 0000000000000000000000000000000000000000..6d39677372b7ffdfc15c4b422700659dd6320f74 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_41.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_41" ( + prepend payload = @./instance_41.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_42.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_42.usda new file mode 100644 index 0000000000000000000000000000000000000000..40d465e4a98ea89a2305219292ed8b5142cc1a07 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_42.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_42" ( + prepend payload = @./instance_42.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_43.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_43.usd new file mode 100644 index 0000000000000000000000000000000000000000..05c8c389aa2c8d2c3f595dfe83cb044073ffb3f3 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_43.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_44.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_44.usda new file mode 100644 index 0000000000000000000000000000000000000000..7c204160b34becb2ec7e4bafb4982ad49b01bd23 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_44.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_44" ( + prepend payload = @./instance_44.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_45.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_45.usda new file mode 100644 index 0000000000000000000000000000000000000000..0a1e8fbceb926f9e469cac3daef4466d5d6227a8 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_45.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_45" ( + prepend payload = @./instance_45.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_48.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_48.usda new file mode 100644 index 0000000000000000000000000000000000000000..985678bdb5878abacfccc01723aee5d5be3f6152 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_48.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_48" ( + prepend payload = @./instance_48.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_49.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_49.usda new file mode 100644 index 0000000000000000000000000000000000000000..56fc225beb52eec1c74315917216d66b488ce385 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_49.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_49" ( + prepend payload = @./instance_49.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_50.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_50.usda new file mode 100644 index 0000000000000000000000000000000000000000..cde13c9d50a29252e84bc5d18ff8d417eb27cebe --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_50.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_50" ( + prepend payload = @./instance_50.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_54.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_54.usda new file mode 100644 index 0000000000000000000000000000000000000000..9cb20e843baae753206440f700d75fc56db64b67 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_54.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_54" ( + prepend payload = @./instance_54.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_58.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_58.usd new file mode 100644 index 0000000000000000000000000000000000000000..de241b9f047e3a853fb4cef08f9dad3b89fa56d9 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_58.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_61.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_61.usda new file mode 100644 index 0000000000000000000000000000000000000000..f7a5e6e517deea038b9f9eba544a2ffa02a79e35 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_61.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_61" ( + prepend payload = @./instance_61.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_63.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_63.usda new file mode 100644 index 0000000000000000000000000000000000000000..e9b60b7ecfada7eab1cbec8a1340359807c30ae3 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_63.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_63" ( + prepend payload = @./instance_63.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_64.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_64.usd new file mode 100644 index 0000000000000000000000000000000000000000..6a2a449a6c7a7e0a17d22c5030e7ba76e845c27d Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_64.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_65.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_65.usd new file mode 100644 index 0000000000000000000000000000000000000000..e5a60e80e9c0a442b09600b0a57eede56ef3bb3d Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_65.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_65.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_65.usda new file mode 100644 index 0000000000000000000000000000000000000000..1b1a242e7a7acc8520f144aeaa741aa2f6e4ad1a --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_65.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_65" ( + prepend payload = @./instance_65.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_67.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_67.usda new file mode 100644 index 0000000000000000000000000000000000000000..fc430995b4b55360153581fb0dc2fea152570760 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_67.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_67" ( + prepend payload = @./instance_67.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_68.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_68.usd new file mode 100644 index 0000000000000000000000000000000000000000..6d98138b5f39b073b9abb2985ab60ae80af50310 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_68.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_69.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_69.usda new file mode 100644 index 0000000000000000000000000000000000000000..d3c18dafc1b9ce5c424dda002d916ca476d16cb1 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_69.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_69" ( + prepend payload = @./instance_69.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_72.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_72.usd new file mode 100644 index 0000000000000000000000000000000000000000..5d56dbd843a11c4b27bbe13080686199faa46937 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_72.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_75.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_75.usd new file mode 100644 index 0000000000000000000000000000000000000000..fe0a21f5ccb07e4460e3048064a94523815ac77a Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_75.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_76.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_76.usd new file mode 100644 index 0000000000000000000000000000000000000000..f9f93ff5a02e40a464be6f5779f18ef0b868c5cd Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_76.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_78.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_78.usd new file mode 100644 index 0000000000000000000000000000000000000000..010cfc64f45756fa0c866acaa4336a26ae172f7b Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_78.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_78.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_78.usda new file mode 100644 index 0000000000000000000000000000000000000000..7f0aea01c0bb467843d0d35e6123885880db0950 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_78.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_78" ( + prepend payload = @./instance_78.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_8.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_8.usd new file mode 100644 index 0000000000000000000000000000000000000000..32dd1b36b82f3efefb2672ae0af5e94f23374622 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_8.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_80.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_80.usda new file mode 100644 index 0000000000000000000000000000000000000000..c4dca550b5a2cc89fe74fad2f19b2009bcd3501f --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_80.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_80" ( + prepend payload = @./instance_80.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_81.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_81.usda new file mode 100644 index 0000000000000000000000000000000000000000..3f717dcbe5046a250e987c6a8f125009afbe1cd5 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_81.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_81" ( + prepend payload = @./instance_81.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_84.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_84.usda new file mode 100644 index 0000000000000000000000000000000000000000..d67d2fd050401350496b1feba21aa4897455f362 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_84.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_84" ( + prepend payload = @./instance_84.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_86.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_86.usda new file mode 100644 index 0000000000000000000000000000000000000000..8e0767bd48de72c89380f961e7ab2412c68cff0e --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_86.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_86" ( + prepend payload = @./instance_86.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_89.usda b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_89.usda new file mode 100644 index 0000000000000000000000000000000000000000..0352081854721a96462f71bd67bd7d2683b3c0a4 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_89.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_instance_89" ( + prepend payload = @./instance_89.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_97.usd b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_97.usd new file mode 100644 index 0000000000000000000000000000000000000000..33848d9f2c0600cabfa51041ea82bb07883ae116 Binary files /dev/null and b/assets/scene_usds/ebench/simple_pnp/task9/SubUSDs/instance_97.usd differ diff --git a/assets/scene_usds/ebench/simple_pnp/task9/scene.usda b/assets/scene_usds/ebench/simple_pnp/task9/scene.usda new file mode 100644 index 0000000000000000000000000000000000000000..8509c1a6d712cebbbdcecf66792dfdb1dee99f97 --- /dev/null +++ b/assets/scene_usds/ebench/simple_pnp/task9/scene.usda @@ -0,0 +1,78 @@ +#usda 1.0 +( + customLayerData = { + dictionary omni_layer = { + dictionary locked = { + } + dictionary muteness = { + } + } + dictionary renderSettings = { + float3 "rtx:debugView:pixelDebug:textColor" = (0, 1e18, 0) + float3 "rtx:fog:fogColor" = (0.75, 0.75, 0.75) + float3 "rtx:index:backgroundColor" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMax" = (0, 0, 0) + float3 "rtx:index:regionOfInterestMin" = (0, 0, 0) + float3 "rtx:post:backgroundZeroAlpha:backgroundDefaultColor" = (0, 0, 0) + float3 "rtx:post:colorcorr:contrast" = (1, 1, 1) + float3 "rtx:post:colorcorr:gain" = (1, 1, 1) + float3 "rtx:post:colorcorr:gamma" = (1, 1, 1) + float3 "rtx:post:colorcorr:offset" = (0, 0, 0) + float3 "rtx:post:colorcorr:saturation" = (1, 1, 1) + float3 "rtx:post:colorgrad:blackpoint" = (0, 0, 0) + float3 "rtx:post:colorgrad:contrast" = (1, 1, 1) + float3 "rtx:post:colorgrad:gain" = (1, 1, 1) + float3 "rtx:post:colorgrad:gamma" = (1, 1, 1) + float3 "rtx:post:colorgrad:lift" = (0, 0, 0) + float3 "rtx:post:colorgrad:multiply" = (1, 1, 1) + float3 "rtx:post:colorgrad:offset" = (0, 0, 0) + float3 "rtx:post:colorgrad:whitepoint" = (1, 1, 1) + float3 "rtx:post:lensDistortion:lensFocalLengthArray" = (10, 30, 50) + float3 "rtx:post:lensFlares:anisoFlareFalloffX" = (450, 475, 500) + float3 "rtx:post:lensFlares:anisoFlareFalloffY" = (10, 10, 10) + float3 "rtx:post:lensFlares:cutoffPoint" = (2, 2, 2) + float3 "rtx:post:lensFlares:haloFlareFalloff" = (10, 10, 10) + float3 "rtx:post:lensFlares:haloFlareRadius" = (75, 75, 75) + float3 "rtx:post:lensFlares:isotropicFlareFalloff" = (50, 50, 50) + float3 "rtx:post:tonemap:whitepoint" = (1, 1, 1) + float3 "rtx:raytracing:indexdirect:svoBrickSize" = (32, 32, 32) + float3 "rtx:raytracing:inscattering:singleScatteringAlbedo" = (0.9, 0.9, 0.9) + float3 "rtx:raytracing:inscattering:transmittanceColor" = (0.5, 0.5, 0.5) + float3 "rtx:sceneDb:ambientLightColor" = (0.1, 0.1, 0.1) + double "rtx:translucency:worldEps" = 0.005 + } + } + defaultPrim = "World" + endTimeCode = 1000000 + metersPerUnit = 1.0 + startTimeCode = 0 + timeCodesPerSecond = 60 + upAxis = "Z" +) + +over "Render" ( + hide_in_stage_window = true +) +{ +} + +def Xform "World" +{ + def "_scene" ( + prepend payload = @./scene.usd@ + ) + { + float3 xformOp:rotateXYZ = (0, 0, 0) + float3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] + } +} + +def Xform "Environment" +{ + double3 xformOp:rotateXYZ = (0, 0, 0) + double3 xformOp:scale = (1, 1, 1) + double3 xformOp:translate = (0, 0, 0) + uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] +} diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/DayMaterial.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/DayMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..70faad25f7b026c6857682dbfb41711032b7dd5a --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/DayMaterial.mdl @@ -0,0 +1,67 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material DayMaterial( + float Flat = 1.0 + [[ + anno::display_name("Flat"), + anno::ui_order(32) + ]], + uniform texture_2d img = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("img"), + anno::ui_order(32), + sampler_color() + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + + float3 Normal_mdl = float3(0.0,0.0,1.0); + + float4 Local0 = tex::lookup_float4(img,float2(CustomizedUV0_mdl.x,1.0-CustomizedUV0_mdl.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local1 = (Flat * float3(Local0.x,Local0.y,Local0.z)); + + float3 EmissiveColor_mdl = Local1; + float Opacity_mdl = Local0.w; + float OpacityMask_mdl = (math::saturate(Local0.w) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = float3(0.0,0.0,0.0); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = 0.5; + float2 Refraction_mdl = float2(float2(1.0,0.0).x,float2(1.0,0.0).x); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/KooPbr.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/KooPbr.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5e993afd51fcee2e32fb4d95cd3570aff2eb9405 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/KooPbr.mdl @@ -0,0 +1,462 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::anno::*; +import ::df::*; +import ::df::color_weighted_layer; +import ::math::*; +import ::state::*; + +export material KooMtl2Sided( + material frontMtl = material() [[ + anno::in_group("Parameters"), + anno::display_name("Front material") + ]], + material backMtl = frontMtl [[ + anno::in_group("Parameters"), + anno::display_name("Back material") + ]], + uniform bool use_backMtl = false [[ + anno::in_group("Parameters"), + anno::display_name("Use back material") + ]], + color translucency = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Basic parameters"), + anno::display_name("Translucency") + ]], + color front_tint = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Front tint"), + anno::hidden() + ]], + color back_tint = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Back tint"), + anno::hidden() + ]], + uniform bool multiply_by_front_diffuse = false [[ + anno::in_group("Basic parameters"), + anno::display_name("Multiply by front diffuse"), + anno::unused(), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + bsdf transmission_bsdf = + df::diffuse_transmission_bsdf(tint: (front_tint + back_tint)*0.5f); + + bsdf front_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : frontMtl.surface.scattering + ); + + bsdf back_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : backMtl.surface.scattering + ); + } in + material( + thin_walled: true, + ior: frontMtl.ior, + surface: material_surface(scattering: front_bsdf), + backface: material_surface(scattering: use_backMtl ? back_bsdf : front_bsdf), + volume: frontMtl.volume, + geometry: frontMtl.geometry + ); + +float emissive_multiplier() uniform +[[ + anno::description("unit conversion from pbrjson emission to mdl"), + anno::noinline() +]] +{ + return 2560.f; +} + +export material KooLightMtl( + color emission = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Emission") + ]], + uniform float emission_mult = 1.f [[ + anno::in_group("Parameters"), + anno::display_name("Mutliplier") + ]], + color opacity = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Opacity") + ]], + uniform bool emit_on_backside = false [[ + anno::in_group("Parameters"), + anno::display_name("Emit light on back side") + ]]) +[[ + anno::author("KooLab") +]] + = + let { + color emission_color = (emission*opacity)*emission_mult * emissive_multiplier(); + + bsdf surface_bsdf = + df::simple_glossy_bsdf + ( + mode: df::scatter_transmit, + tint: color(1.f) - opacity, + roughness_u: 0 + ); + + material_surface emit_surface = material_surface( + scattering: surface_bsdf, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: emission_color) + ); + } in + material( + thin_walled: emit_on_backside, + ior: color(1.f), + surface: emit_surface, + backface: emit_on_backside ? emit_surface : material_surface() + ); + +export material KooMtl( + color diffuse = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("diffuse") + ]], + color reflect = color(0.f, 0.f, 0.f) [[ + anno::in_group("Reflections"), + anno::display_name("reflect") + ]], + float reflect_glossiness = 1.f [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool fresnel = true [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float fresnel_ior = 1.6f [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::hard_range(0.2f, 5.f) + ]], + uniform bool fresnel_ior_lock = true [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refract_ior = 1.6f [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool invert_refraction_ior = false [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + color self_illumination = color(0.f, 0.f, 0.f) [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-Illumination Intensity") + ]], + float anisotropy = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + float3 texmap_bump = state::normal() [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float opacity = 1.f [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + uniform bool thin_walled = false [[ + anno::in_group("Options"), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + float reflection_roughness = math::pow((1.f - reflect_glossiness), 2.f); + + float refl_ior = invert_reflection_ior ? 1.f/(fresnel_ior + 0.01f) : fresnel_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refract_ior + 0.01f) : refract_ior; + + float ior = fresnel_ior_lock ? refr_ior : refl_ior; + float R0 = math::pow((1.f - ior)/(1.f + ior), 2.f); + + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse, + roughness : 0.0f + ), + normal : texmap_bump + ); + + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: fresnel ? reflect : color(1.f), + roughness_u: reflection_roughness + ); + + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: diffuse, + roughness_u: reflection_roughness + ); + + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : fresnel ? color(R0) : reflect, + grazing_reflectivity: fresnel ? color(1.f) : reflect, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ); + } in + material + ( + ior : color(refr_ior), + thin_walled : thin_walled, + surface : material_surface + ( + scattering : surface_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry + ( + cutout_opacity: opacity + ) + ); + +export material KooTranslucentMtl( + color diffuse = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("Diffuse") + ]], + color reflect = color(0.f, 0.f, 0.f) [[ + anno::in_group("Reflections"), + anno::display_name("Reflect") + ]], + float reflect_glossiness = 1.f [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool fresnel = true [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float fresnel_ior = 1.6f [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::soft_range(0.2, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool fresnel_ior_lock = true [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + color refract = color(0.f, 0.f, 0.f) [[ + anno::in_group("Refractions"), + anno::display_name("Refract") + ]], + float refract_glossiness = 1.f [[ + anno::in_group("Refractions"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refract_ior = 1.6f [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool invert_refraction_ior = false [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + color self_illumination = color(0.f, 0.f, 0.f) [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f [[ + anno::in_group("Self-Illumination"), + anno::display_name("Multiplier") + ]], + float anisotropy = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + float3 texmap_bump = state::normal() [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float texmap_opacity = 1.f [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + uniform bool thin_walled = false [[ + anno::in_group("Options"), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + float reflection_roughness = math::pow((1.f - reflect_glossiness), 2.f); + + float refraction_roughness = math::pow((1.f - refract_glossiness), 2.f); + + float refl_ior = invert_reflection_ior ? 1.f/(fresnel_ior + 0.01f) : fresnel_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refract_ior + 0.01f) : refract_ior; + + float ior = fresnel_ior_lock ? refr_ior : refl_ior; + float R0 = math::pow((1.f - ior)/(1.f + ior), 2.f); + + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse, + roughness : 0.f + ), + normal : texmap_bump + ); + + bsdf glossy_transmission_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: color(1.f), + roughness_u: refraction_roughness + ); + + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: fresnel ? reflect : color(1.f), + roughness_u: reflection_roughness + ); + + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: diffuse, + roughness_u: reflection_roughness + ); + + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : fresnel ? color(R0) : reflect, + grazing_reflectivity: fresnel ? color(1.f) : reflect, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : + df::color_weighted_layer + ( + weight : refract, + layer : glossy_transmission_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ), + normal : texmap_bump + ); + } in + material( + thin_walled : thin_walled, + ior : color(refr_ior), + surface : material_surface + ( + scattering : surface_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry(cutout_opacity: texmap_opacity) + ); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/MI_65210daf29931a0001acf634.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/MI_65210daf29931a0001acf634.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b624d2ab107a8299c24444673a3fbe3fb56f0b4b --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/MI_65210daf29931a0001acf634.mdl @@ -0,0 +1,37 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.7; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::KooPbr_maps::KooPbr_alpha_source; +import ::KooPbr_maps::KooPbr_bitmap; +import ::KooPbr_maps::KooPbr_mono_output; +import ::KooPbr_maps::KooPbr_rgb_output; +import ::KooPbr_maps::NormalMap_bump; +import ::anno::description; +import ::base::texture_return; +import ::tex::gamma_mode; + +export material MI_65210daf29931a0001acf634(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: KooPbr_maps::KooPbr_bitmap(1, 1.f, 0.f, 1.f, 1.f, true, false, true, false, 0.f, 0.f, 57.29578018f, 0, texture_2d("../textures/12b9632e893f1e0c0a3054b438e0d9b3e6641b2.jpg", ::tex::gamma_srgb, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f).tint, + reflect: color(0.5490000248f, 0.5490000248f, 0.5490000248f), + reflect_glossiness: 0.6370000243f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: KooPbr_maps::NormalMap_bump(KooPbr_maps::KooPbr_bitmap(1, 1.25f, -0.25f, 1.5f, 1.5f, true, false, true, false, 0.f, 0.f, 57.29578018f, 0, texture_2d("../textures/015f112d608d0ce56e08203201368c1d5927a.jpg", ::tex::gamma_linear, ""), 0.f, 1.f, 0.f, 1.f, KooPbr_maps::mono_output_rgb_intensity, KooPbr_maps::rgb_output_rgb, KooPbr_maps::alpha_source_none, 1.f, false, false, false, 1.f, 1.f, 0.f), state::normal(), 1.f, 1.f, false, false, false, 1, 0.f, 0.1000000015f), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/MI_65210dafb017c50001dd8d3b.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/MI_65210dafb017c50001dd8d3b.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a08a18e28ba59e1a52d4dd1e356494c7ff5c284e --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/MI_65210dafb017c50001dd8d3b.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_65210dafb017c50001dd8d3b(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.02749999985f, 0.02749999985f, 0.02749999985f), + reflect: color(0.09799999744f, 0.09799999744f, 0.09799999744f), + reflect_glossiness: 0.6700000167f, + fresnel: false, + fresnel_ior: 0.8000000119f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/Num5d8344a95b8969000133b8a7.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/Num5d8344a95b8969000133b8a7.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e663ba2f4a439413deb5feb3dcc9bb333bc83a4f --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/Num5d8344a95b8969000133b8a7.mdl @@ -0,0 +1,307 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5d8344a95b8969000133b8a7( + uniform texture_2d Normal_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float Opacity = 0.5 + [[ + anno::display_name("Opacity"), + anno::ui_order(32), + anno::in_group("Translucent") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + uniform float SwitchRefraction = 0.0 + [[ + anno::display_name("SwitchRefraction"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + uniform float FresnelB = 1.517 + [[ + anno::display_name("FresnelB"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + float Local89 = ((math::abs(SwitchRefraction - 1.0) > 0.01) ? (1.0) : FresnelB); + + float3 EmissiveColor_mdl = Local28; + float Opacity_mdl = Opacity; + float OpacityMask_mdl = (math::saturate(Opacity) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + float2 Refraction_mdl = float2(Local89,Local89); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/Num5e7cded4c3afb9000149674f.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/Num5e7cded4c3afb9000149674f.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0605f7e379e8d8468f8f40e69b25149a43cdcc29 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/Num5e7cded4c3afb9000149674f.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5e7cded4c3afb9000149674f( + uniform texture_2d Normal_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("../textures/MV7J6NIKTKJZ2AABAAAAAEI8_usd_study_room_0/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/OmniUe4Base.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/OmniUe4Base.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a441fbaf28040302c7aaabfbcf14b24a85bdf643 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/OmniUe4Base.mdl @@ -0,0 +1,224 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - merge unlit template +//* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side +//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - /* flip_tangent_v */ + tangent_v * normal.y + + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Base( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + float clearcoat_weight = 0.0, + float clearcoat_roughness = 0.0, + float3 clearcoat_normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform bool is_tangent_space_normal = true, + uniform bool two_sided = false, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Base"), + anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::saturate(metallic); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_clearcoat_weight = math::saturate(clearcoat_weight); + float final_clearcoat_roughness = math::saturate(clearcoat_roughness); + float3 final_normal = math::normalize(normal); + float3 final_clearcoat_normal = math::normalize(clearcoat_normal); + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color), + normal: the_normal); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + // clearcoat layer + float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0); + float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness; + + float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ); + + + bsdf clearcoat = + df::custom_curve_layer( + base: df::weighted_layer( + layer: dielectric_metal_mix, + weight: 1.0, + normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal + ), + layer: df::microfacet_ggx_smith_bsdf( + roughness_u: clearcoat_alpha, + tint: color(1.0) + ), + normal_reflectivity: 0.04, + grazing_reflectivity: clearcoat_grazing_refl, + normal: the_clearcoat_normal, + weight: final_clearcoat_weight + ); + bsdf surface = is_unlit ? bsdf() : clearcoat; +} +in material( + thin_walled: two_sided, // Graphene? + surface: material_surface( + scattering: surface, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + backface: material_surface( + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + geometry: material_geometry( + displacement: displacement, + normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(), + cutout_opacity: enable_opacity ? opacity : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/OmniUe4Function.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/OmniUe4Function.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0801afff6f0870ea2574c9e9b6e2043e79e9a79 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/OmniUe4Function.mdl @@ -0,0 +1,1413 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.1 - using absolute import paths when importing standard modules + +mdl 1.6; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + + +export float3 convert_to_left_hand(float3 vec3, uniform bool up_z = true, uniform bool is_position = true) +[[ + anno::description("convert from RH to LH"), + anno::noinline() +]] +{ + float4x4 ZupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4x4 YupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4 vec4 = float4(vec3.x, vec3.y, vec3.z, is_position ? 1.0f : 0.0f); + + vec4 = vec4 * (up_z ? ZupConversion : YupConversion); + + return float3(vec4.x, vec4.y, vec4.z); +} + +export float3 transform_vector_from_tangent_to_world(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from tangent space to world space"), + anno::noinline() +]] +{ + /* flip_tangent_v */ + return convert_to_left_hand( + tangent_u * vector.x - tangent_v * vector.y + state::normal() * vector.z, + up_z, false); +} + +export float3 transform_vector_from_world_to_tangent(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from world space to tangent space"), + anno::noinline() +]] +{ + float3 vecRH = convert_to_left_hand(vector, up_z, false); + /* flip_tangent_v */ + return vecRH.x * float3(tangent_u.x, -tangent_v.x, state::normal().x) + + vecRH.y * float3(tangent_u.y, -tangent_v.y, state::normal().y) + + vecRH.z * float3(tangent_u.z, -tangent_v.z, state::normal().z); +} + +export float4 unpack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Unpack a normal stored in a normal map"), + anno::noinline() +]] +{ + float2 normal_xy = float2(texture_sample.x, texture_sample.y); + + normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0); + float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) ); + return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 ); +} + +// for get color value from normal. +export float4 pack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Pack to color from a normal") +]] +{ + float2 return_xy = float2(texture_sample.x, texture_sample.y); + + return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0); + + return float4( return_xy.x, return_xy.y, 0.0, 1.0 ); +} + +export float4 greyscale_texture_lookup( + float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0) + ) +[[ + anno::description("Sampling a greyscale texture"), + anno::noinline() +]] +{ + return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x); +} + +export float3 pixel_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Pixel normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 vertex_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Vertex normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 landscape_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Landscape normal in world space") +]] +{ + float3 normalFromNormalmap = math::floor((::vertex_normal_world_space(up_z) * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0; + + float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y); + return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY)))); +} + +// Different implementation specific between mdl and hlsl for smoothstep +export float smoothstep(float a, float b, float l) +{ + if (a < b) + { + return math::smoothstep(a, b, l); + } + else if (a > b) + { + return 1.0 - math::smoothstep(b, a, l); + } + else + { + return l <= a ? 0.0 : 1.0; + } +} + +export float2 smoothstep(float2 a, float2 b, float2 l) +{ + return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y)); +} + +export float3 smoothstep(float3 a, float3 b, float3 l) +{ + return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z)); +} + +export float4 smoothstep(float4 a, float4 b, float4 l) +{ + return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w)); +} + +export float2 smoothstep(float2 a, float2 b, float l) +{ + return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l)); +} + +export float3 smoothstep(float3 a, float3 b, float l) +{ + return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l)); +} + +export float4 smoothstep(float4 a, float4 b, float l) +{ + return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l)); +} + +export float2 smoothstep(float a, float b, float2 l) +{ + return float2(smoothstep(a, b, l.x), smoothstep(a, b, l.y)); +} + +export float3 smoothstep(float a, float b, float3 l) +{ + return float3(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z)); +} + +export float4 smoothstep(float a, float b, float4 l) +{ + return float4(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z), smoothstep(a, b, l.w)); +} + +//------------------ Random from UE4 ----------------------- +float length2(float3 v) +{ + return math::dot(v, v); +} + +float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v) +{ + const float2 ZShear = float2(17.0f, 89.0f); + + float2 OffsetA = v.z * ZShear; + float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f; + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat); + return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0; +} + +float3 SkewSimplex(float3 In) +{ + return In + math::dot(In, float3(1.0 / 3.0f) ); +} +float3 UnSkewSimplex(float3 In) +{ + return In - math::dot(In, float3(1.0 / 6.0f) ); +} + +// 3D random number generator inspired by PCGs (permuted congruential generator) +// Using a **simple** Feistel cipher in place of the usual xor shift permutation step +// @param v = 3D integer coordinate +// @return three elements w/ 16 random bits each (0-0xffff). +// ~8 ALU operations for result.x (7 mad, 1 >>) +// ~10 ALU operations for result.xy (8 mad, 2 >>) +// ~12 ALU operations for result.xyz (9 mad, 3 >>) + +//TODO: uint3 +int3 Rand3DPCG16(int3 p) +{ + // taking a signed int then reinterpreting as unsigned gives good behavior for negatives + //TODO: uint3 + int3 v = int3(p); + + // Linear congruential step. These LCG constants are from Numerical Recipies + // For additional #'s, PCG would do multiple LCG steps and scramble each on output + // So v here is the RNG state + v = v * 1664525 + 1013904223; + + // PCG uses xorshift for the final shuffle, but it is expensive (and cheap + // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps + // + // Feistel ciphers divide the state into separate parts (usually by bits) + // then apply a series of permutation steps one part at a time. The permutations + // use a reversible operation (usually ^) to part being updated with the result of + // a permutation function on the other parts and the key. + // + // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for + // the combination function, and just multiplying the other two parts (no key) for + // the permutation function. + // + // That gives a simple mad per round. + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + + // only top 16 bits are well shuffled + return v >> 16; +} + +// Wraps noise for tiling texture creation +// @param v = unwrapped texture parameter +// @param bTiling = true to tile, false to not tile +// @param RepeatSize = number of units before repeating +// @return either original or wrapped coord +float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize) +{ + return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v; +} + +// Evaluate polynomial to get smooth transitions for Perlin noise +// only needed by Perlin functions in this file +// scalar(per component): 2 add, 5 mul +float4 PerlinRamp(float4 t) +{ + return t * t * t * (t * (t * 6 - 15) + 10); +} + +// Blum-Blum-Shub-inspired pseudo random number generator +// http://www.umbc.edu/~olano/papers/mNoise.pdf +// real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes +// instead, we use a single prime M just small enough not to overflow +// note that the above paper used 61, which fits in a half, but is unusably bad +// @param Integer valued floating point seed +// @return random number in range [0,1) +// ~8 ALU operations (5 *, 3 frac) +float RandBBSfloat(float seed) +{ + float BBS_PRIME24 = 4093.0; + float s = math::frac(seed / BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + return s; +} + +// Modified noise gradient term +// @param seed - random seed for integer lattice position +// @param offset - [-1,1] offset of evaluation point from lattice point +// @return gradient direction (xyz) and contribution (w) from this lattice point +float4 MGradient(int seed, float3 offset) +{ + //TODO uint + int rand = Rand3DPCG16(int3(seed,0,0)).x; + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000); + float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1; + return float4(direction.x, direction.y, direction.z, math::dot(direction, offset)); +} + +// compute Perlin and related noise corner seed values +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = true to return seed values for a repeating noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @param seed000-seed111 = hash function seeds for the eight corners +// @return fractional part of v +struct SeedValue +{ + float3 fv = float3(0); + float seed000 = 0; + float seed001 = 0; + float seed010 = 0; + float seed011 = 0; + float seed100 = 0; + float seed101 = 0; + float seed110 = 0; + float seed111 = 0; +}; + +SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds; + seeds.fv = math::frac(v); + float3 iv = math::floor(v); + + const float3 primes = float3(19, 47, 101); + + if (bTiling) + { // can't algebraically combine with primes + seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize)); + seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize)); + seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize)); + seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize)); + seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize)); + seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize)); + seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize)); + seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize)); + } + else + { // get to combine offsets with multiplication by primes in this case + seeds.seed000 = math::dot(iv, primes); + seeds.seed100 = seeds.seed000 + primes.x; + seeds.seed010 = seeds.seed000 + primes.y; + seeds.seed110 = seeds.seed100 + primes.y; + seeds.seed001 = seeds.seed000 + primes.z; + seeds.seed101 = seeds.seed100 + primes.z; + seeds.seed011 = seeds.seed010 + primes.z; + seeds.seed111 = seeds.seed110 + primes.z; + } + + return seeds; +} + +struct SimplexWeights +{ + float4 Result = float4(0); + float3 PosA = float3(0); + float3 PosB = float3(0); + float3 PosC = float3(0); + float3 PosD = float3(0); +}; + +// Computed weights and sample positions for simplex interpolation +// @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d +SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos) +{ + SimplexWeights weights; + float3 OrthogonalPosFloor = math::floor(OrthogonalPos); + + weights.PosA = OrthogonalPosFloor; + weights.PosB = weights.PosA + float3(1, 1, 1); + + OrthogonalPos -= OrthogonalPosFloor; + + float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z)); + float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z)); + + weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z); + weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z); + + float RG = OrthogonalPos.x - OrthogonalPos.y; + float RB = OrthogonalPos.x - OrthogonalPos.z; + float GB = OrthogonalPos.y - OrthogonalPos.z; + + weights.Result.z = + math::min(math::max(0, RG), math::max(0, RB)) // X + + math::min(math::max(0, -RG), math::max(0, GB)) // Y + + math::min(math::max(0, -RB), math::max(0, -GB)); // Z + + weights.Result.w = + math::min(math::max(0, -RG), math::max(0, -RB)) // X + + math::min(math::max(0, RG), math::max(0, -GB)) // Y + + math::min(math::max(0, RB), math::max(0, GB)); // Z + + weights.Result.y = Smallest; + weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w; + + return weights; +} + +// filtered 3D gradient simple noise (few texture lookups, high quality) +// @param v >0 +// @return random number in the range -1 .. 1 +float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos) +{ + float3 OrthogonalPos = SkewSimplex(EvalPos); + + SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos); + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit) + float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA); + float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB); + float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC); + float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD); + + Weights.PosA = UnSkewSimplex(Weights.PosA); + Weights.PosB = UnSkewSimplex(Weights.PosB); + Weights.PosC = UnSkewSimplex(Weights.PosC); + Weights.PosD = UnSkewSimplex(Weights.PosD); + + float DistanceWeight; + + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight; + + return 32 * (a + b + c + d); +} + +// filtered 3D noise, can be optimized +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize) +{ + bTiling = true; + float3 fv = math::frac(v); + float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize); + float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize); + + const int2 ZShear = int2(17, 89); + + float2 OffsetA = iv0.z * ZShear; + float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset + if (bTiling) // tiling, have to compute from wrapped coordinates + { + OffsetB = iv1.z * ZShear; + } + + // Texture size scale factor + float ts = 1 / 128.0f; + + // texture coordinates for iv0.xy, as offset for both z slices + float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts; + float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts; + + // texture coordinates for iv1.xy, as offset for both z slices + float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates + float2 TexB1 = TexB0 + ts; + if (bTiling) // for tiling, need to compute from wrapped coordinates + { + TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts; + TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts; + } + + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit) + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 A = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 B = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 C = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 D = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 E = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 F = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 G = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 H = PerlinNoiseColor * 2 - 1; + + float a = math::dot(A, fv - float3(0, 0, 0)); + float b = math::dot(B, fv - float3(1, 0, 0)); + float c = math::dot(C, fv - float3(0, 1, 0)); + float d = math::dot(D, fv - float3(1, 1, 0)); + float e = math::dot(E, fv - float3(0, 0, 1)); + float f = math::dot(F, fv - float3(1, 0, 1)); + float g = math::dot(G, fv - float3(0, 1, 1)); + float h = math::dot(H, fv - float3(1, 1, 1)); + + float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0))); + + float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y); + float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y); + + return math::lerp(i, j, Weights.z); +} + +// @return random number in the range -1 .. 1 +// scalar: 6 frac, 31 mul/mad, 15 add, +float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz) +{ + // needs to be the same value when creating the PerlinNoise3D texture + float Extent = 16; + + // last texel replicated and needed for filtering + // scalar: 3 frac, 6 mul + xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1); + + // scalar: 3 frac + float3 uvw = math::frac(xyz); + // = floor(xyz); + // scalar: 3 add + float3 p0 = xyz - uvw; +// float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping) + // scalar: 2*3 add 5*3 mul + float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0)); + float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping + // scalar: 3 add + float3 p = p0 + f; + // scalar: 3 mad + // TODO: need reverse??? + float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset + + // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count) + // scalar: 4 mad, 3 mul, 3 add + float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f; + float d = NoiseSample.w * 255.f - 127; + return math::dot(xyz, n) - d; +} + +// Perlin-style "Modified Noise" +// http://www.umbc.edu/~olano/papers/index.html#mNoise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w; + float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w; + float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w; + float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w; + float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w; + float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w; + float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w; + float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D value noise - used to be incorrectly called Perlin noise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1; + float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1; + float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1; + float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1; + float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1; + float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1; + float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1; + float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D jitter offset within a voronoi noise cell +// @param pos - integer lattice corner +// @return random offsets vector +float3 VoronoiCornerSample(float3 pos, int Quality) +{ + // random values in [-0.5, 0.5] + float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5; + + // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 2x2x2 search + if (Quality <= 2) + { + return math::normalize(noise) * 0.2588; + } + + // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 3x3x3 search + if (Quality == 3) + { + return math::normalize(noise) * 0.3090; + } + + // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search + return noise; +} + +// compare previous best with a new candidate +// not producing point locations makes it easier for compiler to eliminate calculations when they're not needed +// @param minval = location and distance of best candidate seed point before the new one +// @param candidate = candidate seed point +// @param offset = 3D offset to new candidate seed point +// @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position +// @return position (if bDistanceOnly is false) and distance to closest seed point so far +float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly) +{ + if (bDistanceOnly) + { + return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset))); + } + else + { + float newdist = math::dot(offset, offset); + return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist); + } +} + +// 220 instruction Worley noise +float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly) +{ + float3 fv = math::frac(v), fv2 = math::frac(v + 0.5); + float3 iv = math::floor(v), iv2 = math::floor(v + 0.5); + + // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away + float4 mindist = float4(0,0,0,100); + float3 p, offset; + + // quality level 3: do a 3x3x3 search + if (Quality == 3) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 1; ++offset_x) + { + for (offset_y = -1; offset_y <= 1; ++offset_y) + { + for (offset_z = -1; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + + // everybody else searches a base 2x2x2 neighborhood + else + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = 0; offset_x <= 1; ++offset_x) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // quality level 2, do extra set of points, offset by half a cell + if (Quality == 2) + { + // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + } + + // quality level 4: add extra sets of four cells in each direction + if (Quality >= 4) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 2; offset_x += 3) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + // along x axis + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along y axis + p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along z axis + p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + } + } + } + } + + // transform squared distance to real distance + return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w)); +} + +// Coordinates for corners of a Simplex tetrahedron +// Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011 +// @param v = 3D noise argument +// @return 4 corner locations +float4x3 SimplexCorners(float3 v) +{ + // find base corner by skewing to tetrahedral space and back + float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3); + float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6; + float3 f = v - base; + + // Find offsets to other corners (McEwan did this in tetrahedral space, + // but since skew is along x=y=z axis, this works in Euclidean space too.) + float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y); + float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0; + + // four corners + return float4x3(base, base + a1, base + a2, base + 0.5); +} + +// Improved smoothing function for simplex noise +// @param f = fractional distance to four tetrahedral corners +// @return weight for each corner +float4 SimplexSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale))); +} + +// Derivative of simplex noise smoothing function +// @param f = fractional distanc eto four tetrahedral corners +// @return derivative of smoothing function for each corner by x, y and z +float3x4 SimplexDSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + s = -12 * scale + s*(24 * scale - s * 12 * scale); + + return float3x4( + s * float4(f[0][0], f[1][0], f[2][0], f[3][0]), + s * float4(f[0][1], f[1][1], f[2][1], f[3][1]), + s * float4(f[0][2], f[1][2], f[2][2], f[3][2])); +} + +// Simplex noise and its Jacobian derivative +// @param v = 3D noise argument +// @param bTiling = whether to repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3 +// @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w +// J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz) +// J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx +// You can use this to compute the noise, gradient, curl, or divergence: +// float3x4 J = JacobianSimplex_ALU(...); +// float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise +// float3 Grad = J[0].xyz; // gradient of J[0].w +// float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]); +// float Div = J[0][0]+J[1][1]+J[2][2]; +// All of these are confirmed to compile out all unneeded terms. +// So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation. +float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize) +{ + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000); + + // corners of tetrahedron + float4x3 T = SimplexCorners(v); + // TODO: uint3 + int3 rand = int3(0); + float4x3 gvec0 = float4x3(1.0); + float4x3 gvec1 = float4x3(1.0); + float4x3 gvec2 = float4x3(1.0); + float4x3 fv = float4x3(1.0); + float3x4 grad = float3x4(1.0); + + // processing of tetrahedral vertices, unrolled + // to compute gradient at each corner + fv[0] = v - T[0]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize)))); + gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][0] = math::dot(gvec0[0], fv[0]); + grad[1][0] = math::dot(gvec1[0], fv[0]); + grad[2][0] = math::dot(gvec2[0], fv[0]); + + fv[1] = v - T[1]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize)))); + gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][1] = math::dot(gvec0[1], fv[1]); + grad[1][1] = math::dot(gvec1[1], fv[1]); + grad[2][1] = math::dot(gvec2[1], fv[1]); + + fv[2] = v - T[2]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize)))); + gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][2] = math::dot(gvec0[2], fv[2]); + grad[1][2] = math::dot(gvec1[2], fv[2]); + grad[2][2] = math::dot(gvec2[2], fv[2]); + + fv[3] = v - T[3]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize)))); + gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][3] = math::dot(gvec0[3], fv[3]); + grad[1][3] = math::dot(gvec1[3], fv[3]); + grad[2][3] = math::dot(gvec2[3], fv[3]); + + // blend gradients + float4 sv = SimplexSmooth(fv); + float3x4 ds = SimplexDSmooth(fv); + + float3x4 jacobian = float3x4(1.0); + float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major) + jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0])); + float3 vec1 = gvec1*sv + grad[1]*ds; + jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1])); + float3 vec2 = gvec2*sv + grad[2]*ds; + jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2])); + + return jacobian; +} + +// While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes +// floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion. +float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize) +{ + // verified, HLSL compiled out the switch if Function is a constant + switch(Function) + { + case 0: + return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position); + case 1: + return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize); + case 2: + return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position); + case 3: + return GradientNoise3D_ALU(Position, bTiling, RepeatSize); + case 4: + return ValueNoise3D_ALU(Position, bTiling, RepeatSize); + case 5: + return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0; + } + return 0; +} +//---------------------------------------------------------- + +export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize) +[[ + anno::description("Noise"), + anno::noinline() +]] +{ + Position *= Scale; + FilterWidth *= Scale; + + float Out = 0.0f; + float OutScale = 1.0f; + float InvLevelScale = 1.0f / LevelScale; + + int iFunction(Function); + int iQuality(Quality); + int iLevels(Levels); + bool bTurbulence(Turbulence); + bool bTiling(Tiling); + + for(int i = 0; i < iLevels; ++i) + { + // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions) + OutScale *= math::saturate(1.0 - FilterWidth); + + if(bTurbulence) + { + Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale; + } + else + { + Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale; + } + + Position *= LevelScale; + RepeatSize *= LevelScale; + OutScale *= InvLevelScale; + FilterWidth *= LevelScale; + } + + if(!bTurbulence) + { + // bring -1..1 to 0..1 range + Out = Out * 0.5f + 0.5f; + } + + // Out is in 0..1 range + return math::lerp(OutputMin, OutputMax, Out); +} + +// Material node for noise functions returning a vector value +// @param LevelScale usually 2 but higher values allow efficient use of few levels +// @return in user defined range (OutputMin..OutputMax) +export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise"), + anno::noinline() +]] +{ + float4 result = float4(0,0,0,1); + float3 ret = float3(0); + int iQuality = int(Quality); + int iFunction = int(Function); + bool bTiling = Tiling > 0.0; + + float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used + + // verified, HLSL compiled out the switch if Function is a constant + switch (iFunction) + { + case 0: // Cellnoise + ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff; + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 1: // Color noise + ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 2: // Gradient + result = Jacobian[0]; + break; + case 3: // Curl + ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 4: // Voronoi + result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false); + break; + } + return result; +} + +export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise float3 version"), + anno::noinline() +]] +{ + float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize); + return float3(noise.x, noise.y, noise.z); +} + + +// workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view +export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]]) +[[ + anno::description("Fresnel"), + anno::noinline() +]] +{ + return 0.0; +} + +export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]], + bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]], + bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]], + bool clamp_fresnel_dot_product [[anno::unused()]]) +[[ + anno::description("Fresnel Function"), + anno::noinline() +]] +{ + return 0.0; +} + +export float3 camera_vector(uniform bool up_z = true) +[[ + anno::description("Camera Vector"), + anno::noinline() +]] +{ + // assume camera postion is 0,0,0 + return math::normalize(float3(0) - convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)); +} + +export float pixel_depth() +[[ + anno::description("Pixel Depth"), + anno::noinline() +]] +{ + return 256.0f; +} + +export float scene_depth() +[[ + anno::description("Scene Depth") +]] +{ + return 65500.0f; +} + +export float3 scene_color() +[[ + anno::description("Scene Color") +]] +{ + return float3(1.0f); +} + +export float4 vertex_color() +[[ + anno::description("Vertex Color"), + anno::noinline() +]] +{ + return float4(1.0f); +} + +export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex) +[[ + anno::description("Vertex Color for float2 PrimVar"), + anno::noinline() +]] +{ + // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead + return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y); +} + +export float3 camera_position() +[[ + anno::description("Camera Position"), + anno::noinline() +]] +{ + return float3(1000.0f, 0, 0); +} + +export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position) +[[ + anno::description("Rotates Position about the given axis by the given angle") +]] +{ + // Project Position onto the rotation axis and find the closest point on the axis to Position + float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z); + float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis); + // Construct orthogonal axes in the plane of the rotation + float3 UAxis = Position - ClosestPointOnAxis; + float3 VAxis = math::cross(NormalizedRotationAxis, UAxis); + float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w); + // Rotate using the orthogonal axes + float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0]; + // Reconstruct the rotated world space position + float3 RotatedPosition = ClosestPointOnAxis + R; + // Convert from position to a position offset + return RotatedPosition - Position; +} + +export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset) +[[ + anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied") +]] +{ + return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset; +} + +export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal, uniform bool up_z = true) +[[ + anno::description("Reflection vector about the specified world space normal") +]] +{ + if (bNormalizeInputNormal) + { + WorldNormal = math::normalize(WorldNormal); + } + + return -camera_vector(up_z) + WorldNormal * math::dot(WorldNormal, camera_vector(up_z)) * 2.0; +} + +export float3 reflection_vector(uniform bool up_z = true) +[[ + anno::description("Reflection Vector"), + anno::noinline() +]] +{ + float3 normal = convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); + return reflection_custom_world_normal(normal, false, up_z); +} + +export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]]) +[[ + anno::description("Dither TemporalAA"), + anno::noinline() +]] +{ + return AlphaThreshold; +} + +export float3 black_body( float Temp ) +[[ + anno::description("Black Body"), + anno::noinline() +]] +{ + float u = ( 0.860117757f + 1.54118254e-4f * Temp + 1.28641212e-7f * Temp*Temp ) / ( 1.0f + 8.42420235e-4f * Temp + 7.08145163e-7f * Temp*Temp ); + float v = ( 0.317398726f + 4.22806245e-5f * Temp + 4.20481691e-8f * Temp*Temp ) / ( 1.0f - 2.89741816e-5f * Temp + 1.61456053e-7f * Temp*Temp ); + + float x = 3*u / ( 2*u - 8*v + 4 ); + float y = 2*v / ( 2*u - 8*v + 4 ); + float z = 1 - x - y; + + float Y = 1; + float X = Y/y * x; + float Z = Y/y * z; + + float3x3 XYZtoRGB = float3x3( + float3(3.2404542, -1.5371385, -0.4985314), + float3(-0.9692660, 1.8760108, 0.0415560), + float3(0.0556434, -0.2040259, 1.0572252) + ); + + return XYZtoRGB * float3( X, Y, Z ) * math::pow( 0.0004 * Temp, 4 ); +} + +export float per_instance_random(uniform texture_2d PerlinNoiseGradientTexture, int NumberInstances) +[[ + anno::description("Per Instance Random"), + anno::noinline() +]] +{ + float weight = state::object_id() / float(NumberInstances); + return NumberInstances == 0 ? 0.0 : tex::lookup_float4(PerlinNoiseGradientTexture, float2(weight, 1.0 - weight), tex::wrap_repeat, tex::wrap_repeat).x; +} + +//------------------ Hair from UE4 ----------------------- +float3 hair_absorption_to_color(float3 A) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::exp(-math::sqrt(A) * D); +} + +float3 hair_color_to_absorption(float3 C) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::pow(math::log(C) / D, 2.0f); +} + +export float3 get_hair_color_from_melanin(float InMelanin, float InRedness, float3 InDyeColor) +[[ + anno::description("Hair Color") +]] +{ + InMelanin = math::saturate(InMelanin); + InRedness = math::saturate(InRedness); + float Melanin = -math::log(math::max(1 - InMelanin, 0.0001f)); + float Eumelanin = Melanin * (1 - InRedness); + float Pheomelanin = Melanin * InRedness; + + float3 DyeAbsorption = hair_color_to_absorption(math::saturate(InDyeColor)); + float3 Absorption = Eumelanin * float3(0.506f, 0.841f, 1.653f) + Pheomelanin * float3(0.343f, 0.733f, 1.924f); + + return hair_absorption_to_color(Absorption + DyeAbsorption); +} + +export float3 local_object_bounds_min() +[[ + anno::description("Local Object Bounds Min"), + anno::noinline() +]] +{ + return float3(0.0); +} + +export float3 local_object_bounds_max() +[[ + anno::description("Local Object Bounds Max"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float3 object_bounds() +[[ + anno::description("Object Bounds"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float object_radius() +[[ + anno::description("Object Radius"), + anno::noinline() +]] +{ + return 100.0f; +} + +export float3 object_world_position(uniform bool up_z = true) +[[ + anno::description("Object World Position"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)*state::meters_per_scene_unit()*100.0; +} + +export float3 object_orientation() +[[ + anno::description("Object Orientation"), + anno::noinline() +]] +{ + return float3(0); +} + +export float rcp(float x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float2 rcp(float2 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float3 rcp(float3 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float4 rcp(float4 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export int BitFieldExtractI32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractI32 int"), + anno::noinline() +]] +{ + Size &= 3; + Offset &= 3; + + if (Size == 0) + return 0; + else if (Offset + Size < 32) + return (Data << (32 - Size - Offset)) >> (32 - Size); + else + return Data >> Offset; +} + +export int BitFieldExtractI32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractI32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(int(Data), int(Size), int(Offset)); +} + +export int BitFieldExtractU32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractU32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export int BitFieldExtractU32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractU32 int"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export float3 EyeAdaptationInverseLookup(float3 LightValue, float Alpha) +[[ + anno::description("EyeAdaptationInverseLookup"), + anno::noinline() +]] +{ + float Adaptation = 1.0f; + + // When Alpha=0.0, we want to multiply by 1.0. when Alpha = 1.0, we want to multiply by 1/Adaptation. + // So the lerped value is: + // LerpLogScale = Lerp(log(1),log(1/Adaptaiton),T) + // Which is simplified as: + // LerpLogScale = Lerp(0,-log(Adaptation),T) + // LerpLogScale = -T * logAdaptation; + + float LerpLogScale = -Alpha * math::log(Adaptation); + float Scale = math::exp(LerpLogScale); + return LightValue * Scale; +} diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/OmniUe4Translucent.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/OmniUe4Translucent.mdl new file mode 100644 index 0000000000000000000000000000000000000000..483a83004b8f7d5bf820a7905d06ea2d7d5894af --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/OmniUe4Translucent.mdl @@ -0,0 +1,233 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - Emissive color affected by opacity +// - Support opacity mask +//* 1.0.2 - Unlit translucent +//* 1.0.3 - specular bsdf instead of microfacet ggx smith bsdf +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +color get_translucent_tint(color base_color, float opacity) +[[ + anno::description("base color of UE4 translucent"), + anno::noinline() +]] +{ + return math::lerp(color(1.0), base_color, opacity); +} + +// Just for UE4 distilling +float get_translucent_opacity(float opacity) +[[ + anno::noinline() +]] +{ + return opacity; +} + +color get_emissive_intensity(color emissive, float opacity) +[[ + anno::description("emissive color of UE4 translucent"), + anno::noinline() +]] +{ + return emissive * opacity; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - + tangent_v * normal.y + /* flip_tangent_v */ + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Translucent( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float opacity_mask = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform float refraction = 1.0, + uniform bool two_sided = false, + uniform bool is_tangent_space_normal = true, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Translucent"), + anno::description("Omni UE4 Translucent, supports UE4 Translucent shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "translucent")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::min(math::max(metallic, 0.0f), 0.99f); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_opacity = math::saturate(opacity); + float3 final_normal = math::normalize(normal); + + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color)); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + bsdf frosted_bsdf = df::specular_bsdf( + tint: color(1), + mode: df::scatter_reflect_transmit + ); + + bsdf final_mix_bsdf = + is_unlit ? df::specular_bsdf( + tint: get_translucent_tint(base_color: final_base_color, opacity: final_opacity), + mode: df::scatter_reflect_transmit + ) + : df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: dielectric_metal_mix, + weight: get_translucent_opacity(final_opacity)), + df::bsdf_component( + component: frosted_bsdf, + weight: 1.0-get_translucent_opacity(final_opacity)) + ) + ); +} +in material( + thin_walled: two_sided, // Graphene? + ior: color(refraction), //refraction + surface: material_surface( + scattering: final_mix_bsdf, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: get_emissive_intensity(emissive: final_emissive_color, opacity: final_opacity) + ) + ), + + geometry: material_geometry( + displacement: displacement, + normal: the_normal, + cutout_opacity: enable_opacity ? opacity_mask : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/WorldGridMaterial.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/WorldGridMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8040029cab1073713e0c535664dd57ed7f6b5522 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/GRSceneUSD_dexterous/task7/Collected_scene/SubUSDs/materials/WorldGridMaterial.mdl @@ -0,0 +1,75 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material WorldGridMaterial( + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (CustomizedUV0_mdl / 2.0); + float2 Local1 = (Local0 / 0.05); + float4 Local2 = ::unpack_normal_map(tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_N.png",::tex::gamma_linear),float2(Local1.x,1.0-Local1.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local3 = (float3(Local2.x,Local2.y,Local2.z) * float3(0.3,0.3,1.0)); + + float3 Normal_mdl = Local3; + + float2 Local4 = (CustomizedUV0_mdl * 20.0); + float4 Local5 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat); + float Local6 = math::lerp(0.4,1.0,Local5.x); + float Local7 = (1.0 - Local6); + float2 Local8 = (Local0 / 0.1); + float4 Local9 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local8.x,1.0-Local8.y),tex::wrap_repeat,tex::wrap_repeat); + float Local10 = math::lerp(Local9.y,1.0,0.0); + float Local11 = math::lerp(Local6,Local7,Local10); + float4 Local12 = tex::lookup_float4(texture_2d("../textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat); + float Local13 = math::lerp(Local9.y,0.0,0.0); + float Local14 = (Local12.y + Local13); + float Local15 = math::lerp(Local14,0.5,0.5); + float Local16 = math::lerp(0.295,0.66,Local15); + float Local17 = (Local16 * 0.5); + float Local18 = (Local11 * Local17); + float Local19 = math::lerp(0.0,0.5,Local12.y); + float Local20 = math::lerp(0.7,1.0,Local9.y); + float Local21 = math::lerp(Local20,1.0,0.0); + float Local22 = (Local21 * 1.0); + float Local23 = (Local19 + Local22); + float Local24 = math::min(math::max(Local23,0.0),1.0); + + float3 EmissiveColor_mdl = float3(0.0,0.0,0.0); + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = float3(Local18,Local18,Local18); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = Local24; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/table_material/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5cc80aa20b160a6671d2417d.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/table_material/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5cc80aa20b160a6671d2417d.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cce2706bb137dd9ea17f4dc84e8972dd0ee978ff --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/table_material/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5cc80aa20b160a6671d2417d.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5cc80aa20b160a6671d2417d( + uniform texture_2d Normal_Tex = texture_2d("./Textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("./Textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/table_material/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/table_material/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a441fbaf28040302c7aaabfbcf14b24a85bdf643 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/table_material/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl @@ -0,0 +1,224 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - merge unlit template +//* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side +//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - /* flip_tangent_v */ + tangent_v * normal.y + + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Base( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + float clearcoat_weight = 0.0, + float clearcoat_roughness = 0.0, + float3 clearcoat_normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform bool is_tangent_space_normal = true, + uniform bool two_sided = false, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Base"), + anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::saturate(metallic); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_clearcoat_weight = math::saturate(clearcoat_weight); + float final_clearcoat_roughness = math::saturate(clearcoat_roughness); + float3 final_normal = math::normalize(normal); + float3 final_clearcoat_normal = math::normalize(clearcoat_normal); + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color), + normal: the_normal); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + // clearcoat layer + float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0); + float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness; + + float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ); + + + bsdf clearcoat = + df::custom_curve_layer( + base: df::weighted_layer( + layer: dielectric_metal_mix, + weight: 1.0, + normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal + ), + layer: df::microfacet_ggx_smith_bsdf( + roughness_u: clearcoat_alpha, + tint: color(1.0) + ), + normal_reflectivity: 0.04, + grazing_reflectivity: clearcoat_grazing_refl, + normal: the_clearcoat_normal, + weight: final_clearcoat_weight + ); + bsdf surface = is_unlit ? bsdf() : clearcoat; +} +in material( + thin_walled: two_sided, // Graphene? + surface: material_surface( + scattering: surface, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + backface: material_surface( + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + geometry: material_geometry( + displacement: displacement, + normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(), + cutout_opacity: enable_opacity ? opacity : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/table_material/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/table_material/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0801afff6f0870ea2574c9e9b6e2043e79e9a79 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/collect_coffee_beans/table_material/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl @@ -0,0 +1,1413 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.1 - using absolute import paths when importing standard modules + +mdl 1.6; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + + +export float3 convert_to_left_hand(float3 vec3, uniform bool up_z = true, uniform bool is_position = true) +[[ + anno::description("convert from RH to LH"), + anno::noinline() +]] +{ + float4x4 ZupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4x4 YupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4 vec4 = float4(vec3.x, vec3.y, vec3.z, is_position ? 1.0f : 0.0f); + + vec4 = vec4 * (up_z ? ZupConversion : YupConversion); + + return float3(vec4.x, vec4.y, vec4.z); +} + +export float3 transform_vector_from_tangent_to_world(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from tangent space to world space"), + anno::noinline() +]] +{ + /* flip_tangent_v */ + return convert_to_left_hand( + tangent_u * vector.x - tangent_v * vector.y + state::normal() * vector.z, + up_z, false); +} + +export float3 transform_vector_from_world_to_tangent(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from world space to tangent space"), + anno::noinline() +]] +{ + float3 vecRH = convert_to_left_hand(vector, up_z, false); + /* flip_tangent_v */ + return vecRH.x * float3(tangent_u.x, -tangent_v.x, state::normal().x) + + vecRH.y * float3(tangent_u.y, -tangent_v.y, state::normal().y) + + vecRH.z * float3(tangent_u.z, -tangent_v.z, state::normal().z); +} + +export float4 unpack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Unpack a normal stored in a normal map"), + anno::noinline() +]] +{ + float2 normal_xy = float2(texture_sample.x, texture_sample.y); + + normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0); + float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) ); + return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 ); +} + +// for get color value from normal. +export float4 pack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Pack to color from a normal") +]] +{ + float2 return_xy = float2(texture_sample.x, texture_sample.y); + + return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0); + + return float4( return_xy.x, return_xy.y, 0.0, 1.0 ); +} + +export float4 greyscale_texture_lookup( + float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0) + ) +[[ + anno::description("Sampling a greyscale texture"), + anno::noinline() +]] +{ + return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x); +} + +export float3 pixel_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Pixel normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 vertex_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Vertex normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 landscape_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Landscape normal in world space") +]] +{ + float3 normalFromNormalmap = math::floor((::vertex_normal_world_space(up_z) * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0; + + float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y); + return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY)))); +} + +// Different implementation specific between mdl and hlsl for smoothstep +export float smoothstep(float a, float b, float l) +{ + if (a < b) + { + return math::smoothstep(a, b, l); + } + else if (a > b) + { + return 1.0 - math::smoothstep(b, a, l); + } + else + { + return l <= a ? 0.0 : 1.0; + } +} + +export float2 smoothstep(float2 a, float2 b, float2 l) +{ + return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y)); +} + +export float3 smoothstep(float3 a, float3 b, float3 l) +{ + return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z)); +} + +export float4 smoothstep(float4 a, float4 b, float4 l) +{ + return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w)); +} + +export float2 smoothstep(float2 a, float2 b, float l) +{ + return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l)); +} + +export float3 smoothstep(float3 a, float3 b, float l) +{ + return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l)); +} + +export float4 smoothstep(float4 a, float4 b, float l) +{ + return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l)); +} + +export float2 smoothstep(float a, float b, float2 l) +{ + return float2(smoothstep(a, b, l.x), smoothstep(a, b, l.y)); +} + +export float3 smoothstep(float a, float b, float3 l) +{ + return float3(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z)); +} + +export float4 smoothstep(float a, float b, float4 l) +{ + return float4(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z), smoothstep(a, b, l.w)); +} + +//------------------ Random from UE4 ----------------------- +float length2(float3 v) +{ + return math::dot(v, v); +} + +float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v) +{ + const float2 ZShear = float2(17.0f, 89.0f); + + float2 OffsetA = v.z * ZShear; + float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f; + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat); + return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0; +} + +float3 SkewSimplex(float3 In) +{ + return In + math::dot(In, float3(1.0 / 3.0f) ); +} +float3 UnSkewSimplex(float3 In) +{ + return In - math::dot(In, float3(1.0 / 6.0f) ); +} + +// 3D random number generator inspired by PCGs (permuted congruential generator) +// Using a **simple** Feistel cipher in place of the usual xor shift permutation step +// @param v = 3D integer coordinate +// @return three elements w/ 16 random bits each (0-0xffff). +// ~8 ALU operations for result.x (7 mad, 1 >>) +// ~10 ALU operations for result.xy (8 mad, 2 >>) +// ~12 ALU operations for result.xyz (9 mad, 3 >>) + +//TODO: uint3 +int3 Rand3DPCG16(int3 p) +{ + // taking a signed int then reinterpreting as unsigned gives good behavior for negatives + //TODO: uint3 + int3 v = int3(p); + + // Linear congruential step. These LCG constants are from Numerical Recipies + // For additional #'s, PCG would do multiple LCG steps and scramble each on output + // So v here is the RNG state + v = v * 1664525 + 1013904223; + + // PCG uses xorshift for the final shuffle, but it is expensive (and cheap + // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps + // + // Feistel ciphers divide the state into separate parts (usually by bits) + // then apply a series of permutation steps one part at a time. The permutations + // use a reversible operation (usually ^) to part being updated with the result of + // a permutation function on the other parts and the key. + // + // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for + // the combination function, and just multiplying the other two parts (no key) for + // the permutation function. + // + // That gives a simple mad per round. + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + + // only top 16 bits are well shuffled + return v >> 16; +} + +// Wraps noise for tiling texture creation +// @param v = unwrapped texture parameter +// @param bTiling = true to tile, false to not tile +// @param RepeatSize = number of units before repeating +// @return either original or wrapped coord +float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize) +{ + return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v; +} + +// Evaluate polynomial to get smooth transitions for Perlin noise +// only needed by Perlin functions in this file +// scalar(per component): 2 add, 5 mul +float4 PerlinRamp(float4 t) +{ + return t * t * t * (t * (t * 6 - 15) + 10); +} + +// Blum-Blum-Shub-inspired pseudo random number generator +// http://www.umbc.edu/~olano/papers/mNoise.pdf +// real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes +// instead, we use a single prime M just small enough not to overflow +// note that the above paper used 61, which fits in a half, but is unusably bad +// @param Integer valued floating point seed +// @return random number in range [0,1) +// ~8 ALU operations (5 *, 3 frac) +float RandBBSfloat(float seed) +{ + float BBS_PRIME24 = 4093.0; + float s = math::frac(seed / BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + return s; +} + +// Modified noise gradient term +// @param seed - random seed for integer lattice position +// @param offset - [-1,1] offset of evaluation point from lattice point +// @return gradient direction (xyz) and contribution (w) from this lattice point +float4 MGradient(int seed, float3 offset) +{ + //TODO uint + int rand = Rand3DPCG16(int3(seed,0,0)).x; + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000); + float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1; + return float4(direction.x, direction.y, direction.z, math::dot(direction, offset)); +} + +// compute Perlin and related noise corner seed values +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = true to return seed values for a repeating noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @param seed000-seed111 = hash function seeds for the eight corners +// @return fractional part of v +struct SeedValue +{ + float3 fv = float3(0); + float seed000 = 0; + float seed001 = 0; + float seed010 = 0; + float seed011 = 0; + float seed100 = 0; + float seed101 = 0; + float seed110 = 0; + float seed111 = 0; +}; + +SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds; + seeds.fv = math::frac(v); + float3 iv = math::floor(v); + + const float3 primes = float3(19, 47, 101); + + if (bTiling) + { // can't algebraically combine with primes + seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize)); + seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize)); + seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize)); + seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize)); + seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize)); + seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize)); + seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize)); + seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize)); + } + else + { // get to combine offsets with multiplication by primes in this case + seeds.seed000 = math::dot(iv, primes); + seeds.seed100 = seeds.seed000 + primes.x; + seeds.seed010 = seeds.seed000 + primes.y; + seeds.seed110 = seeds.seed100 + primes.y; + seeds.seed001 = seeds.seed000 + primes.z; + seeds.seed101 = seeds.seed100 + primes.z; + seeds.seed011 = seeds.seed010 + primes.z; + seeds.seed111 = seeds.seed110 + primes.z; + } + + return seeds; +} + +struct SimplexWeights +{ + float4 Result = float4(0); + float3 PosA = float3(0); + float3 PosB = float3(0); + float3 PosC = float3(0); + float3 PosD = float3(0); +}; + +// Computed weights and sample positions for simplex interpolation +// @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d +SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos) +{ + SimplexWeights weights; + float3 OrthogonalPosFloor = math::floor(OrthogonalPos); + + weights.PosA = OrthogonalPosFloor; + weights.PosB = weights.PosA + float3(1, 1, 1); + + OrthogonalPos -= OrthogonalPosFloor; + + float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z)); + float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z)); + + weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z); + weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z); + + float RG = OrthogonalPos.x - OrthogonalPos.y; + float RB = OrthogonalPos.x - OrthogonalPos.z; + float GB = OrthogonalPos.y - OrthogonalPos.z; + + weights.Result.z = + math::min(math::max(0, RG), math::max(0, RB)) // X + + math::min(math::max(0, -RG), math::max(0, GB)) // Y + + math::min(math::max(0, -RB), math::max(0, -GB)); // Z + + weights.Result.w = + math::min(math::max(0, -RG), math::max(0, -RB)) // X + + math::min(math::max(0, RG), math::max(0, -GB)) // Y + + math::min(math::max(0, RB), math::max(0, GB)); // Z + + weights.Result.y = Smallest; + weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w; + + return weights; +} + +// filtered 3D gradient simple noise (few texture lookups, high quality) +// @param v >0 +// @return random number in the range -1 .. 1 +float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos) +{ + float3 OrthogonalPos = SkewSimplex(EvalPos); + + SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos); + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit) + float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA); + float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB); + float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC); + float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD); + + Weights.PosA = UnSkewSimplex(Weights.PosA); + Weights.PosB = UnSkewSimplex(Weights.PosB); + Weights.PosC = UnSkewSimplex(Weights.PosC); + Weights.PosD = UnSkewSimplex(Weights.PosD); + + float DistanceWeight; + + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight; + + return 32 * (a + b + c + d); +} + +// filtered 3D noise, can be optimized +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize) +{ + bTiling = true; + float3 fv = math::frac(v); + float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize); + float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize); + + const int2 ZShear = int2(17, 89); + + float2 OffsetA = iv0.z * ZShear; + float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset + if (bTiling) // tiling, have to compute from wrapped coordinates + { + OffsetB = iv1.z * ZShear; + } + + // Texture size scale factor + float ts = 1 / 128.0f; + + // texture coordinates for iv0.xy, as offset for both z slices + float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts; + float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts; + + // texture coordinates for iv1.xy, as offset for both z slices + float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates + float2 TexB1 = TexB0 + ts; + if (bTiling) // for tiling, need to compute from wrapped coordinates + { + TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts; + TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts; + } + + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit) + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 A = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 B = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 C = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 D = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 E = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 F = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 G = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 H = PerlinNoiseColor * 2 - 1; + + float a = math::dot(A, fv - float3(0, 0, 0)); + float b = math::dot(B, fv - float3(1, 0, 0)); + float c = math::dot(C, fv - float3(0, 1, 0)); + float d = math::dot(D, fv - float3(1, 1, 0)); + float e = math::dot(E, fv - float3(0, 0, 1)); + float f = math::dot(F, fv - float3(1, 0, 1)); + float g = math::dot(G, fv - float3(0, 1, 1)); + float h = math::dot(H, fv - float3(1, 1, 1)); + + float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0))); + + float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y); + float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y); + + return math::lerp(i, j, Weights.z); +} + +// @return random number in the range -1 .. 1 +// scalar: 6 frac, 31 mul/mad, 15 add, +float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz) +{ + // needs to be the same value when creating the PerlinNoise3D texture + float Extent = 16; + + // last texel replicated and needed for filtering + // scalar: 3 frac, 6 mul + xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1); + + // scalar: 3 frac + float3 uvw = math::frac(xyz); + // = floor(xyz); + // scalar: 3 add + float3 p0 = xyz - uvw; +// float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping) + // scalar: 2*3 add 5*3 mul + float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0)); + float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping + // scalar: 3 add + float3 p = p0 + f; + // scalar: 3 mad + // TODO: need reverse??? + float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset + + // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count) + // scalar: 4 mad, 3 mul, 3 add + float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f; + float d = NoiseSample.w * 255.f - 127; + return math::dot(xyz, n) - d; +} + +// Perlin-style "Modified Noise" +// http://www.umbc.edu/~olano/papers/index.html#mNoise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w; + float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w; + float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w; + float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w; + float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w; + float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w; + float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w; + float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D value noise - used to be incorrectly called Perlin noise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1; + float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1; + float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1; + float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1; + float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1; + float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1; + float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1; + float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D jitter offset within a voronoi noise cell +// @param pos - integer lattice corner +// @return random offsets vector +float3 VoronoiCornerSample(float3 pos, int Quality) +{ + // random values in [-0.5, 0.5] + float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5; + + // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 2x2x2 search + if (Quality <= 2) + { + return math::normalize(noise) * 0.2588; + } + + // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 3x3x3 search + if (Quality == 3) + { + return math::normalize(noise) * 0.3090; + } + + // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search + return noise; +} + +// compare previous best with a new candidate +// not producing point locations makes it easier for compiler to eliminate calculations when they're not needed +// @param minval = location and distance of best candidate seed point before the new one +// @param candidate = candidate seed point +// @param offset = 3D offset to new candidate seed point +// @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position +// @return position (if bDistanceOnly is false) and distance to closest seed point so far +float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly) +{ + if (bDistanceOnly) + { + return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset))); + } + else + { + float newdist = math::dot(offset, offset); + return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist); + } +} + +// 220 instruction Worley noise +float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly) +{ + float3 fv = math::frac(v), fv2 = math::frac(v + 0.5); + float3 iv = math::floor(v), iv2 = math::floor(v + 0.5); + + // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away + float4 mindist = float4(0,0,0,100); + float3 p, offset; + + // quality level 3: do a 3x3x3 search + if (Quality == 3) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 1; ++offset_x) + { + for (offset_y = -1; offset_y <= 1; ++offset_y) + { + for (offset_z = -1; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + + // everybody else searches a base 2x2x2 neighborhood + else + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = 0; offset_x <= 1; ++offset_x) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // quality level 2, do extra set of points, offset by half a cell + if (Quality == 2) + { + // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + } + + // quality level 4: add extra sets of four cells in each direction + if (Quality >= 4) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 2; offset_x += 3) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + // along x axis + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along y axis + p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along z axis + p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + } + } + } + } + + // transform squared distance to real distance + return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w)); +} + +// Coordinates for corners of a Simplex tetrahedron +// Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011 +// @param v = 3D noise argument +// @return 4 corner locations +float4x3 SimplexCorners(float3 v) +{ + // find base corner by skewing to tetrahedral space and back + float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3); + float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6; + float3 f = v - base; + + // Find offsets to other corners (McEwan did this in tetrahedral space, + // but since skew is along x=y=z axis, this works in Euclidean space too.) + float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y); + float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0; + + // four corners + return float4x3(base, base + a1, base + a2, base + 0.5); +} + +// Improved smoothing function for simplex noise +// @param f = fractional distance to four tetrahedral corners +// @return weight for each corner +float4 SimplexSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale))); +} + +// Derivative of simplex noise smoothing function +// @param f = fractional distanc eto four tetrahedral corners +// @return derivative of smoothing function for each corner by x, y and z +float3x4 SimplexDSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + s = -12 * scale + s*(24 * scale - s * 12 * scale); + + return float3x4( + s * float4(f[0][0], f[1][0], f[2][0], f[3][0]), + s * float4(f[0][1], f[1][1], f[2][1], f[3][1]), + s * float4(f[0][2], f[1][2], f[2][2], f[3][2])); +} + +// Simplex noise and its Jacobian derivative +// @param v = 3D noise argument +// @param bTiling = whether to repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3 +// @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w +// J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz) +// J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx +// You can use this to compute the noise, gradient, curl, or divergence: +// float3x4 J = JacobianSimplex_ALU(...); +// float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise +// float3 Grad = J[0].xyz; // gradient of J[0].w +// float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]); +// float Div = J[0][0]+J[1][1]+J[2][2]; +// All of these are confirmed to compile out all unneeded terms. +// So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation. +float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize) +{ + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000); + + // corners of tetrahedron + float4x3 T = SimplexCorners(v); + // TODO: uint3 + int3 rand = int3(0); + float4x3 gvec0 = float4x3(1.0); + float4x3 gvec1 = float4x3(1.0); + float4x3 gvec2 = float4x3(1.0); + float4x3 fv = float4x3(1.0); + float3x4 grad = float3x4(1.0); + + // processing of tetrahedral vertices, unrolled + // to compute gradient at each corner + fv[0] = v - T[0]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize)))); + gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][0] = math::dot(gvec0[0], fv[0]); + grad[1][0] = math::dot(gvec1[0], fv[0]); + grad[2][0] = math::dot(gvec2[0], fv[0]); + + fv[1] = v - T[1]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize)))); + gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][1] = math::dot(gvec0[1], fv[1]); + grad[1][1] = math::dot(gvec1[1], fv[1]); + grad[2][1] = math::dot(gvec2[1], fv[1]); + + fv[2] = v - T[2]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize)))); + gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][2] = math::dot(gvec0[2], fv[2]); + grad[1][2] = math::dot(gvec1[2], fv[2]); + grad[2][2] = math::dot(gvec2[2], fv[2]); + + fv[3] = v - T[3]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize)))); + gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][3] = math::dot(gvec0[3], fv[3]); + grad[1][3] = math::dot(gvec1[3], fv[3]); + grad[2][3] = math::dot(gvec2[3], fv[3]); + + // blend gradients + float4 sv = SimplexSmooth(fv); + float3x4 ds = SimplexDSmooth(fv); + + float3x4 jacobian = float3x4(1.0); + float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major) + jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0])); + float3 vec1 = gvec1*sv + grad[1]*ds; + jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1])); + float3 vec2 = gvec2*sv + grad[2]*ds; + jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2])); + + return jacobian; +} + +// While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes +// floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion. +float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize) +{ + // verified, HLSL compiled out the switch if Function is a constant + switch(Function) + { + case 0: + return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position); + case 1: + return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize); + case 2: + return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position); + case 3: + return GradientNoise3D_ALU(Position, bTiling, RepeatSize); + case 4: + return ValueNoise3D_ALU(Position, bTiling, RepeatSize); + case 5: + return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0; + } + return 0; +} +//---------------------------------------------------------- + +export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize) +[[ + anno::description("Noise"), + anno::noinline() +]] +{ + Position *= Scale; + FilterWidth *= Scale; + + float Out = 0.0f; + float OutScale = 1.0f; + float InvLevelScale = 1.0f / LevelScale; + + int iFunction(Function); + int iQuality(Quality); + int iLevels(Levels); + bool bTurbulence(Turbulence); + bool bTiling(Tiling); + + for(int i = 0; i < iLevels; ++i) + { + // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions) + OutScale *= math::saturate(1.0 - FilterWidth); + + if(bTurbulence) + { + Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale; + } + else + { + Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale; + } + + Position *= LevelScale; + RepeatSize *= LevelScale; + OutScale *= InvLevelScale; + FilterWidth *= LevelScale; + } + + if(!bTurbulence) + { + // bring -1..1 to 0..1 range + Out = Out * 0.5f + 0.5f; + } + + // Out is in 0..1 range + return math::lerp(OutputMin, OutputMax, Out); +} + +// Material node for noise functions returning a vector value +// @param LevelScale usually 2 but higher values allow efficient use of few levels +// @return in user defined range (OutputMin..OutputMax) +export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise"), + anno::noinline() +]] +{ + float4 result = float4(0,0,0,1); + float3 ret = float3(0); + int iQuality = int(Quality); + int iFunction = int(Function); + bool bTiling = Tiling > 0.0; + + float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used + + // verified, HLSL compiled out the switch if Function is a constant + switch (iFunction) + { + case 0: // Cellnoise + ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff; + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 1: // Color noise + ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 2: // Gradient + result = Jacobian[0]; + break; + case 3: // Curl + ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 4: // Voronoi + result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false); + break; + } + return result; +} + +export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise float3 version"), + anno::noinline() +]] +{ + float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize); + return float3(noise.x, noise.y, noise.z); +} + + +// workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view +export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]]) +[[ + anno::description("Fresnel"), + anno::noinline() +]] +{ + return 0.0; +} + +export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]], + bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]], + bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]], + bool clamp_fresnel_dot_product [[anno::unused()]]) +[[ + anno::description("Fresnel Function"), + anno::noinline() +]] +{ + return 0.0; +} + +export float3 camera_vector(uniform bool up_z = true) +[[ + anno::description("Camera Vector"), + anno::noinline() +]] +{ + // assume camera postion is 0,0,0 + return math::normalize(float3(0) - convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)); +} + +export float pixel_depth() +[[ + anno::description("Pixel Depth"), + anno::noinline() +]] +{ + return 256.0f; +} + +export float scene_depth() +[[ + anno::description("Scene Depth") +]] +{ + return 65500.0f; +} + +export float3 scene_color() +[[ + anno::description("Scene Color") +]] +{ + return float3(1.0f); +} + +export float4 vertex_color() +[[ + anno::description("Vertex Color"), + anno::noinline() +]] +{ + return float4(1.0f); +} + +export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex) +[[ + anno::description("Vertex Color for float2 PrimVar"), + anno::noinline() +]] +{ + // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead + return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y); +} + +export float3 camera_position() +[[ + anno::description("Camera Position"), + anno::noinline() +]] +{ + return float3(1000.0f, 0, 0); +} + +export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position) +[[ + anno::description("Rotates Position about the given axis by the given angle") +]] +{ + // Project Position onto the rotation axis and find the closest point on the axis to Position + float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z); + float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis); + // Construct orthogonal axes in the plane of the rotation + float3 UAxis = Position - ClosestPointOnAxis; + float3 VAxis = math::cross(NormalizedRotationAxis, UAxis); + float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w); + // Rotate using the orthogonal axes + float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0]; + // Reconstruct the rotated world space position + float3 RotatedPosition = ClosestPointOnAxis + R; + // Convert from position to a position offset + return RotatedPosition - Position; +} + +export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset) +[[ + anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied") +]] +{ + return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset; +} + +export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal, uniform bool up_z = true) +[[ + anno::description("Reflection vector about the specified world space normal") +]] +{ + if (bNormalizeInputNormal) + { + WorldNormal = math::normalize(WorldNormal); + } + + return -camera_vector(up_z) + WorldNormal * math::dot(WorldNormal, camera_vector(up_z)) * 2.0; +} + +export float3 reflection_vector(uniform bool up_z = true) +[[ + anno::description("Reflection Vector"), + anno::noinline() +]] +{ + float3 normal = convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); + return reflection_custom_world_normal(normal, false, up_z); +} + +export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]]) +[[ + anno::description("Dither TemporalAA"), + anno::noinline() +]] +{ + return AlphaThreshold; +} + +export float3 black_body( float Temp ) +[[ + anno::description("Black Body"), + anno::noinline() +]] +{ + float u = ( 0.860117757f + 1.54118254e-4f * Temp + 1.28641212e-7f * Temp*Temp ) / ( 1.0f + 8.42420235e-4f * Temp + 7.08145163e-7f * Temp*Temp ); + float v = ( 0.317398726f + 4.22806245e-5f * Temp + 4.20481691e-8f * Temp*Temp ) / ( 1.0f - 2.89741816e-5f * Temp + 1.61456053e-7f * Temp*Temp ); + + float x = 3*u / ( 2*u - 8*v + 4 ); + float y = 2*v / ( 2*u - 8*v + 4 ); + float z = 1 - x - y; + + float Y = 1; + float X = Y/y * x; + float Z = Y/y * z; + + float3x3 XYZtoRGB = float3x3( + float3(3.2404542, -1.5371385, -0.4985314), + float3(-0.9692660, 1.8760108, 0.0415560), + float3(0.0556434, -0.2040259, 1.0572252) + ); + + return XYZtoRGB * float3( X, Y, Z ) * math::pow( 0.0004 * Temp, 4 ); +} + +export float per_instance_random(uniform texture_2d PerlinNoiseGradientTexture, int NumberInstances) +[[ + anno::description("Per Instance Random"), + anno::noinline() +]] +{ + float weight = state::object_id() / float(NumberInstances); + return NumberInstances == 0 ? 0.0 : tex::lookup_float4(PerlinNoiseGradientTexture, float2(weight, 1.0 - weight), tex::wrap_repeat, tex::wrap_repeat).x; +} + +//------------------ Hair from UE4 ----------------------- +float3 hair_absorption_to_color(float3 A) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::exp(-math::sqrt(A) * D); +} + +float3 hair_color_to_absorption(float3 C) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::pow(math::log(C) / D, 2.0f); +} + +export float3 get_hair_color_from_melanin(float InMelanin, float InRedness, float3 InDyeColor) +[[ + anno::description("Hair Color") +]] +{ + InMelanin = math::saturate(InMelanin); + InRedness = math::saturate(InRedness); + float Melanin = -math::log(math::max(1 - InMelanin, 0.0001f)); + float Eumelanin = Melanin * (1 - InRedness); + float Pheomelanin = Melanin * InRedness; + + float3 DyeAbsorption = hair_color_to_absorption(math::saturate(InDyeColor)); + float3 Absorption = Eumelanin * float3(0.506f, 0.841f, 1.653f) + Pheomelanin * float3(0.343f, 0.733f, 1.924f); + + return hair_absorption_to_color(Absorption + DyeAbsorption); +} + +export float3 local_object_bounds_min() +[[ + anno::description("Local Object Bounds Min"), + anno::noinline() +]] +{ + return float3(0.0); +} + +export float3 local_object_bounds_max() +[[ + anno::description("Local Object Bounds Max"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float3 object_bounds() +[[ + anno::description("Object Bounds"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float object_radius() +[[ + anno::description("Object Radius"), + anno::noinline() +]] +{ + return 100.0f; +} + +export float3 object_world_position(uniform bool up_z = true) +[[ + anno::description("Object World Position"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)*state::meters_per_scene_unit()*100.0; +} + +export float3 object_orientation() +[[ + anno::description("Object Orientation"), + anno::noinline() +]] +{ + return float3(0); +} + +export float rcp(float x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float2 rcp(float2 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float3 rcp(float3 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float4 rcp(float4 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export int BitFieldExtractI32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractI32 int"), + anno::noinline() +]] +{ + Size &= 3; + Offset &= 3; + + if (Size == 0) + return 0; + else if (Offset + Size < 32) + return (Data << (32 - Size - Offset)) >> (32 - Size); + else + return Data >> Offset; +} + +export int BitFieldExtractI32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractI32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(int(Data), int(Size), int(Offset)); +} + +export int BitFieldExtractU32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractU32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export int BitFieldExtractU32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractU32 int"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export float3 EyeAdaptationInverseLookup(float3 LightValue, float Alpha) +[[ + anno::description("EyeAdaptationInverseLookup"), + anno::noinline() +]] +{ + float Adaptation = 1.0f; + + // When Alpha=0.0, we want to multiply by 1.0. when Alpha = 1.0, we want to multiply by 1/Adaptation. + // So the lerped value is: + // LerpLogScale = Lerp(log(1),log(1/Adaptaiton),T) + // Which is simplified as: + // LerpLogScale = Lerp(0,-log(Adaptation),T) + // LerpLogScale = -T * logAdaptation; + + float LerpLogScale = -Alpha * math::log(Adaptation); + float Scale = math::exp(LerpLogScale); + return LightValue * Scale; +} diff --git a/assets/scene_usds/ebench/teleop_tasks/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5cc80aa20b160a6671d2417d.mdl b/assets/scene_usds/ebench/teleop_tasks/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5cc80aa20b160a6671d2417d.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cce2706bb137dd9ea17f4dc84e8972dd0ee978ff --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5cc80aa20b160a6671d2417d.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5cc80aa20b160a6671d2417d( + uniform texture_2d Normal_Tex = texture_2d("./Textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("./Textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl b/assets/scene_usds/ebench/teleop_tasks/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a441fbaf28040302c7aaabfbcf14b24a85bdf643 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl @@ -0,0 +1,224 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - merge unlit template +//* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side +//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - /* flip_tangent_v */ + tangent_v * normal.y + + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Base( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + float clearcoat_weight = 0.0, + float clearcoat_roughness = 0.0, + float3 clearcoat_normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform bool is_tangent_space_normal = true, + uniform bool two_sided = false, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Base"), + anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::saturate(metallic); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_clearcoat_weight = math::saturate(clearcoat_weight); + float final_clearcoat_roughness = math::saturate(clearcoat_roughness); + float3 final_normal = math::normalize(normal); + float3 final_clearcoat_normal = math::normalize(clearcoat_normal); + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color), + normal: the_normal); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + // clearcoat layer + float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0); + float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness; + + float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ); + + + bsdf clearcoat = + df::custom_curve_layer( + base: df::weighted_layer( + layer: dielectric_metal_mix, + weight: 1.0, + normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal + ), + layer: df::microfacet_ggx_smith_bsdf( + roughness_u: clearcoat_alpha, + tint: color(1.0) + ), + normal_reflectivity: 0.04, + grazing_reflectivity: clearcoat_grazing_refl, + normal: the_clearcoat_normal, + weight: final_clearcoat_weight + ); + bsdf surface = is_unlit ? bsdf() : clearcoat; +} +in material( + thin_walled: two_sided, // Graphene? + surface: material_surface( + scattering: surface, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + backface: material_surface( + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + geometry: material_geometry( + displacement: displacement, + normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(), + cutout_opacity: enable_opacity ? opacity : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/teleop_tasks/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl b/assets/scene_usds/ebench/teleop_tasks/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0801afff6f0870ea2574c9e9b6e2043e79e9a79 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl @@ -0,0 +1,1413 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.1 - using absolute import paths when importing standard modules + +mdl 1.6; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + + +export float3 convert_to_left_hand(float3 vec3, uniform bool up_z = true, uniform bool is_position = true) +[[ + anno::description("convert from RH to LH"), + anno::noinline() +]] +{ + float4x4 ZupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4x4 YupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4 vec4 = float4(vec3.x, vec3.y, vec3.z, is_position ? 1.0f : 0.0f); + + vec4 = vec4 * (up_z ? ZupConversion : YupConversion); + + return float3(vec4.x, vec4.y, vec4.z); +} + +export float3 transform_vector_from_tangent_to_world(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from tangent space to world space"), + anno::noinline() +]] +{ + /* flip_tangent_v */ + return convert_to_left_hand( + tangent_u * vector.x - tangent_v * vector.y + state::normal() * vector.z, + up_z, false); +} + +export float3 transform_vector_from_world_to_tangent(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from world space to tangent space"), + anno::noinline() +]] +{ + float3 vecRH = convert_to_left_hand(vector, up_z, false); + /* flip_tangent_v */ + return vecRH.x * float3(tangent_u.x, -tangent_v.x, state::normal().x) + + vecRH.y * float3(tangent_u.y, -tangent_v.y, state::normal().y) + + vecRH.z * float3(tangent_u.z, -tangent_v.z, state::normal().z); +} + +export float4 unpack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Unpack a normal stored in a normal map"), + anno::noinline() +]] +{ + float2 normal_xy = float2(texture_sample.x, texture_sample.y); + + normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0); + float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) ); + return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 ); +} + +// for get color value from normal. +export float4 pack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Pack to color from a normal") +]] +{ + float2 return_xy = float2(texture_sample.x, texture_sample.y); + + return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0); + + return float4( return_xy.x, return_xy.y, 0.0, 1.0 ); +} + +export float4 greyscale_texture_lookup( + float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0) + ) +[[ + anno::description("Sampling a greyscale texture"), + anno::noinline() +]] +{ + return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x); +} + +export float3 pixel_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Pixel normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 vertex_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Vertex normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 landscape_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Landscape normal in world space") +]] +{ + float3 normalFromNormalmap = math::floor((::vertex_normal_world_space(up_z) * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0; + + float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y); + return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY)))); +} + +// Different implementation specific between mdl and hlsl for smoothstep +export float smoothstep(float a, float b, float l) +{ + if (a < b) + { + return math::smoothstep(a, b, l); + } + else if (a > b) + { + return 1.0 - math::smoothstep(b, a, l); + } + else + { + return l <= a ? 0.0 : 1.0; + } +} + +export float2 smoothstep(float2 a, float2 b, float2 l) +{ + return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y)); +} + +export float3 smoothstep(float3 a, float3 b, float3 l) +{ + return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z)); +} + +export float4 smoothstep(float4 a, float4 b, float4 l) +{ + return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w)); +} + +export float2 smoothstep(float2 a, float2 b, float l) +{ + return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l)); +} + +export float3 smoothstep(float3 a, float3 b, float l) +{ + return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l)); +} + +export float4 smoothstep(float4 a, float4 b, float l) +{ + return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l)); +} + +export float2 smoothstep(float a, float b, float2 l) +{ + return float2(smoothstep(a, b, l.x), smoothstep(a, b, l.y)); +} + +export float3 smoothstep(float a, float b, float3 l) +{ + return float3(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z)); +} + +export float4 smoothstep(float a, float b, float4 l) +{ + return float4(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z), smoothstep(a, b, l.w)); +} + +//------------------ Random from UE4 ----------------------- +float length2(float3 v) +{ + return math::dot(v, v); +} + +float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v) +{ + const float2 ZShear = float2(17.0f, 89.0f); + + float2 OffsetA = v.z * ZShear; + float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f; + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat); + return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0; +} + +float3 SkewSimplex(float3 In) +{ + return In + math::dot(In, float3(1.0 / 3.0f) ); +} +float3 UnSkewSimplex(float3 In) +{ + return In - math::dot(In, float3(1.0 / 6.0f) ); +} + +// 3D random number generator inspired by PCGs (permuted congruential generator) +// Using a **simple** Feistel cipher in place of the usual xor shift permutation step +// @param v = 3D integer coordinate +// @return three elements w/ 16 random bits each (0-0xffff). +// ~8 ALU operations for result.x (7 mad, 1 >>) +// ~10 ALU operations for result.xy (8 mad, 2 >>) +// ~12 ALU operations for result.xyz (9 mad, 3 >>) + +//TODO: uint3 +int3 Rand3DPCG16(int3 p) +{ + // taking a signed int then reinterpreting as unsigned gives good behavior for negatives + //TODO: uint3 + int3 v = int3(p); + + // Linear congruential step. These LCG constants are from Numerical Recipies + // For additional #'s, PCG would do multiple LCG steps and scramble each on output + // So v here is the RNG state + v = v * 1664525 + 1013904223; + + // PCG uses xorshift for the final shuffle, but it is expensive (and cheap + // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps + // + // Feistel ciphers divide the state into separate parts (usually by bits) + // then apply a series of permutation steps one part at a time. The permutations + // use a reversible operation (usually ^) to part being updated with the result of + // a permutation function on the other parts and the key. + // + // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for + // the combination function, and just multiplying the other two parts (no key) for + // the permutation function. + // + // That gives a simple mad per round. + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + + // only top 16 bits are well shuffled + return v >> 16; +} + +// Wraps noise for tiling texture creation +// @param v = unwrapped texture parameter +// @param bTiling = true to tile, false to not tile +// @param RepeatSize = number of units before repeating +// @return either original or wrapped coord +float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize) +{ + return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v; +} + +// Evaluate polynomial to get smooth transitions for Perlin noise +// only needed by Perlin functions in this file +// scalar(per component): 2 add, 5 mul +float4 PerlinRamp(float4 t) +{ + return t * t * t * (t * (t * 6 - 15) + 10); +} + +// Blum-Blum-Shub-inspired pseudo random number generator +// http://www.umbc.edu/~olano/papers/mNoise.pdf +// real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes +// instead, we use a single prime M just small enough not to overflow +// note that the above paper used 61, which fits in a half, but is unusably bad +// @param Integer valued floating point seed +// @return random number in range [0,1) +// ~8 ALU operations (5 *, 3 frac) +float RandBBSfloat(float seed) +{ + float BBS_PRIME24 = 4093.0; + float s = math::frac(seed / BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + return s; +} + +// Modified noise gradient term +// @param seed - random seed for integer lattice position +// @param offset - [-1,1] offset of evaluation point from lattice point +// @return gradient direction (xyz) and contribution (w) from this lattice point +float4 MGradient(int seed, float3 offset) +{ + //TODO uint + int rand = Rand3DPCG16(int3(seed,0,0)).x; + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000); + float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1; + return float4(direction.x, direction.y, direction.z, math::dot(direction, offset)); +} + +// compute Perlin and related noise corner seed values +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = true to return seed values for a repeating noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @param seed000-seed111 = hash function seeds for the eight corners +// @return fractional part of v +struct SeedValue +{ + float3 fv = float3(0); + float seed000 = 0; + float seed001 = 0; + float seed010 = 0; + float seed011 = 0; + float seed100 = 0; + float seed101 = 0; + float seed110 = 0; + float seed111 = 0; +}; + +SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds; + seeds.fv = math::frac(v); + float3 iv = math::floor(v); + + const float3 primes = float3(19, 47, 101); + + if (bTiling) + { // can't algebraically combine with primes + seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize)); + seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize)); + seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize)); + seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize)); + seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize)); + seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize)); + seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize)); + seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize)); + } + else + { // get to combine offsets with multiplication by primes in this case + seeds.seed000 = math::dot(iv, primes); + seeds.seed100 = seeds.seed000 + primes.x; + seeds.seed010 = seeds.seed000 + primes.y; + seeds.seed110 = seeds.seed100 + primes.y; + seeds.seed001 = seeds.seed000 + primes.z; + seeds.seed101 = seeds.seed100 + primes.z; + seeds.seed011 = seeds.seed010 + primes.z; + seeds.seed111 = seeds.seed110 + primes.z; + } + + return seeds; +} + +struct SimplexWeights +{ + float4 Result = float4(0); + float3 PosA = float3(0); + float3 PosB = float3(0); + float3 PosC = float3(0); + float3 PosD = float3(0); +}; + +// Computed weights and sample positions for simplex interpolation +// @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d +SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos) +{ + SimplexWeights weights; + float3 OrthogonalPosFloor = math::floor(OrthogonalPos); + + weights.PosA = OrthogonalPosFloor; + weights.PosB = weights.PosA + float3(1, 1, 1); + + OrthogonalPos -= OrthogonalPosFloor; + + float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z)); + float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z)); + + weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z); + weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z); + + float RG = OrthogonalPos.x - OrthogonalPos.y; + float RB = OrthogonalPos.x - OrthogonalPos.z; + float GB = OrthogonalPos.y - OrthogonalPos.z; + + weights.Result.z = + math::min(math::max(0, RG), math::max(0, RB)) // X + + math::min(math::max(0, -RG), math::max(0, GB)) // Y + + math::min(math::max(0, -RB), math::max(0, -GB)); // Z + + weights.Result.w = + math::min(math::max(0, -RG), math::max(0, -RB)) // X + + math::min(math::max(0, RG), math::max(0, -GB)) // Y + + math::min(math::max(0, RB), math::max(0, GB)); // Z + + weights.Result.y = Smallest; + weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w; + + return weights; +} + +// filtered 3D gradient simple noise (few texture lookups, high quality) +// @param v >0 +// @return random number in the range -1 .. 1 +float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos) +{ + float3 OrthogonalPos = SkewSimplex(EvalPos); + + SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos); + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit) + float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA); + float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB); + float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC); + float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD); + + Weights.PosA = UnSkewSimplex(Weights.PosA); + Weights.PosB = UnSkewSimplex(Weights.PosB); + Weights.PosC = UnSkewSimplex(Weights.PosC); + Weights.PosD = UnSkewSimplex(Weights.PosD); + + float DistanceWeight; + + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight; + + return 32 * (a + b + c + d); +} + +// filtered 3D noise, can be optimized +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize) +{ + bTiling = true; + float3 fv = math::frac(v); + float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize); + float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize); + + const int2 ZShear = int2(17, 89); + + float2 OffsetA = iv0.z * ZShear; + float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset + if (bTiling) // tiling, have to compute from wrapped coordinates + { + OffsetB = iv1.z * ZShear; + } + + // Texture size scale factor + float ts = 1 / 128.0f; + + // texture coordinates for iv0.xy, as offset for both z slices + float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts; + float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts; + + // texture coordinates for iv1.xy, as offset for both z slices + float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates + float2 TexB1 = TexB0 + ts; + if (bTiling) // for tiling, need to compute from wrapped coordinates + { + TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts; + TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts; + } + + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit) + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 A = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 B = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 C = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 D = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 E = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 F = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 G = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 H = PerlinNoiseColor * 2 - 1; + + float a = math::dot(A, fv - float3(0, 0, 0)); + float b = math::dot(B, fv - float3(1, 0, 0)); + float c = math::dot(C, fv - float3(0, 1, 0)); + float d = math::dot(D, fv - float3(1, 1, 0)); + float e = math::dot(E, fv - float3(0, 0, 1)); + float f = math::dot(F, fv - float3(1, 0, 1)); + float g = math::dot(G, fv - float3(0, 1, 1)); + float h = math::dot(H, fv - float3(1, 1, 1)); + + float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0))); + + float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y); + float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y); + + return math::lerp(i, j, Weights.z); +} + +// @return random number in the range -1 .. 1 +// scalar: 6 frac, 31 mul/mad, 15 add, +float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz) +{ + // needs to be the same value when creating the PerlinNoise3D texture + float Extent = 16; + + // last texel replicated and needed for filtering + // scalar: 3 frac, 6 mul + xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1); + + // scalar: 3 frac + float3 uvw = math::frac(xyz); + // = floor(xyz); + // scalar: 3 add + float3 p0 = xyz - uvw; +// float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping) + // scalar: 2*3 add 5*3 mul + float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0)); + float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping + // scalar: 3 add + float3 p = p0 + f; + // scalar: 3 mad + // TODO: need reverse??? + float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset + + // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count) + // scalar: 4 mad, 3 mul, 3 add + float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f; + float d = NoiseSample.w * 255.f - 127; + return math::dot(xyz, n) - d; +} + +// Perlin-style "Modified Noise" +// http://www.umbc.edu/~olano/papers/index.html#mNoise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w; + float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w; + float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w; + float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w; + float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w; + float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w; + float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w; + float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D value noise - used to be incorrectly called Perlin noise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1; + float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1; + float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1; + float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1; + float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1; + float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1; + float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1; + float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D jitter offset within a voronoi noise cell +// @param pos - integer lattice corner +// @return random offsets vector +float3 VoronoiCornerSample(float3 pos, int Quality) +{ + // random values in [-0.5, 0.5] + float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5; + + // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 2x2x2 search + if (Quality <= 2) + { + return math::normalize(noise) * 0.2588; + } + + // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 3x3x3 search + if (Quality == 3) + { + return math::normalize(noise) * 0.3090; + } + + // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search + return noise; +} + +// compare previous best with a new candidate +// not producing point locations makes it easier for compiler to eliminate calculations when they're not needed +// @param minval = location and distance of best candidate seed point before the new one +// @param candidate = candidate seed point +// @param offset = 3D offset to new candidate seed point +// @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position +// @return position (if bDistanceOnly is false) and distance to closest seed point so far +float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly) +{ + if (bDistanceOnly) + { + return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset))); + } + else + { + float newdist = math::dot(offset, offset); + return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist); + } +} + +// 220 instruction Worley noise +float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly) +{ + float3 fv = math::frac(v), fv2 = math::frac(v + 0.5); + float3 iv = math::floor(v), iv2 = math::floor(v + 0.5); + + // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away + float4 mindist = float4(0,0,0,100); + float3 p, offset; + + // quality level 3: do a 3x3x3 search + if (Quality == 3) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 1; ++offset_x) + { + for (offset_y = -1; offset_y <= 1; ++offset_y) + { + for (offset_z = -1; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + + // everybody else searches a base 2x2x2 neighborhood + else + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = 0; offset_x <= 1; ++offset_x) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // quality level 2, do extra set of points, offset by half a cell + if (Quality == 2) + { + // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + } + + // quality level 4: add extra sets of four cells in each direction + if (Quality >= 4) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 2; offset_x += 3) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + // along x axis + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along y axis + p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along z axis + p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + } + } + } + } + + // transform squared distance to real distance + return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w)); +} + +// Coordinates for corners of a Simplex tetrahedron +// Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011 +// @param v = 3D noise argument +// @return 4 corner locations +float4x3 SimplexCorners(float3 v) +{ + // find base corner by skewing to tetrahedral space and back + float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3); + float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6; + float3 f = v - base; + + // Find offsets to other corners (McEwan did this in tetrahedral space, + // but since skew is along x=y=z axis, this works in Euclidean space too.) + float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y); + float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0; + + // four corners + return float4x3(base, base + a1, base + a2, base + 0.5); +} + +// Improved smoothing function for simplex noise +// @param f = fractional distance to four tetrahedral corners +// @return weight for each corner +float4 SimplexSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale))); +} + +// Derivative of simplex noise smoothing function +// @param f = fractional distanc eto four tetrahedral corners +// @return derivative of smoothing function for each corner by x, y and z +float3x4 SimplexDSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + s = -12 * scale + s*(24 * scale - s * 12 * scale); + + return float3x4( + s * float4(f[0][0], f[1][0], f[2][0], f[3][0]), + s * float4(f[0][1], f[1][1], f[2][1], f[3][1]), + s * float4(f[0][2], f[1][2], f[2][2], f[3][2])); +} + +// Simplex noise and its Jacobian derivative +// @param v = 3D noise argument +// @param bTiling = whether to repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3 +// @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w +// J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz) +// J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx +// You can use this to compute the noise, gradient, curl, or divergence: +// float3x4 J = JacobianSimplex_ALU(...); +// float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise +// float3 Grad = J[0].xyz; // gradient of J[0].w +// float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]); +// float Div = J[0][0]+J[1][1]+J[2][2]; +// All of these are confirmed to compile out all unneeded terms. +// So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation. +float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize) +{ + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000); + + // corners of tetrahedron + float4x3 T = SimplexCorners(v); + // TODO: uint3 + int3 rand = int3(0); + float4x3 gvec0 = float4x3(1.0); + float4x3 gvec1 = float4x3(1.0); + float4x3 gvec2 = float4x3(1.0); + float4x3 fv = float4x3(1.0); + float3x4 grad = float3x4(1.0); + + // processing of tetrahedral vertices, unrolled + // to compute gradient at each corner + fv[0] = v - T[0]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize)))); + gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][0] = math::dot(gvec0[0], fv[0]); + grad[1][0] = math::dot(gvec1[0], fv[0]); + grad[2][0] = math::dot(gvec2[0], fv[0]); + + fv[1] = v - T[1]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize)))); + gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][1] = math::dot(gvec0[1], fv[1]); + grad[1][1] = math::dot(gvec1[1], fv[1]); + grad[2][1] = math::dot(gvec2[1], fv[1]); + + fv[2] = v - T[2]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize)))); + gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][2] = math::dot(gvec0[2], fv[2]); + grad[1][2] = math::dot(gvec1[2], fv[2]); + grad[2][2] = math::dot(gvec2[2], fv[2]); + + fv[3] = v - T[3]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize)))); + gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][3] = math::dot(gvec0[3], fv[3]); + grad[1][3] = math::dot(gvec1[3], fv[3]); + grad[2][3] = math::dot(gvec2[3], fv[3]); + + // blend gradients + float4 sv = SimplexSmooth(fv); + float3x4 ds = SimplexDSmooth(fv); + + float3x4 jacobian = float3x4(1.0); + float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major) + jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0])); + float3 vec1 = gvec1*sv + grad[1]*ds; + jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1])); + float3 vec2 = gvec2*sv + grad[2]*ds; + jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2])); + + return jacobian; +} + +// While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes +// floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion. +float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize) +{ + // verified, HLSL compiled out the switch if Function is a constant + switch(Function) + { + case 0: + return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position); + case 1: + return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize); + case 2: + return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position); + case 3: + return GradientNoise3D_ALU(Position, bTiling, RepeatSize); + case 4: + return ValueNoise3D_ALU(Position, bTiling, RepeatSize); + case 5: + return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0; + } + return 0; +} +//---------------------------------------------------------- + +export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize) +[[ + anno::description("Noise"), + anno::noinline() +]] +{ + Position *= Scale; + FilterWidth *= Scale; + + float Out = 0.0f; + float OutScale = 1.0f; + float InvLevelScale = 1.0f / LevelScale; + + int iFunction(Function); + int iQuality(Quality); + int iLevels(Levels); + bool bTurbulence(Turbulence); + bool bTiling(Tiling); + + for(int i = 0; i < iLevels; ++i) + { + // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions) + OutScale *= math::saturate(1.0 - FilterWidth); + + if(bTurbulence) + { + Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale; + } + else + { + Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale; + } + + Position *= LevelScale; + RepeatSize *= LevelScale; + OutScale *= InvLevelScale; + FilterWidth *= LevelScale; + } + + if(!bTurbulence) + { + // bring -1..1 to 0..1 range + Out = Out * 0.5f + 0.5f; + } + + // Out is in 0..1 range + return math::lerp(OutputMin, OutputMax, Out); +} + +// Material node for noise functions returning a vector value +// @param LevelScale usually 2 but higher values allow efficient use of few levels +// @return in user defined range (OutputMin..OutputMax) +export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise"), + anno::noinline() +]] +{ + float4 result = float4(0,0,0,1); + float3 ret = float3(0); + int iQuality = int(Quality); + int iFunction = int(Function); + bool bTiling = Tiling > 0.0; + + float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used + + // verified, HLSL compiled out the switch if Function is a constant + switch (iFunction) + { + case 0: // Cellnoise + ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff; + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 1: // Color noise + ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 2: // Gradient + result = Jacobian[0]; + break; + case 3: // Curl + ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 4: // Voronoi + result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false); + break; + } + return result; +} + +export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise float3 version"), + anno::noinline() +]] +{ + float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize); + return float3(noise.x, noise.y, noise.z); +} + + +// workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view +export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]]) +[[ + anno::description("Fresnel"), + anno::noinline() +]] +{ + return 0.0; +} + +export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]], + bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]], + bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]], + bool clamp_fresnel_dot_product [[anno::unused()]]) +[[ + anno::description("Fresnel Function"), + anno::noinline() +]] +{ + return 0.0; +} + +export float3 camera_vector(uniform bool up_z = true) +[[ + anno::description("Camera Vector"), + anno::noinline() +]] +{ + // assume camera postion is 0,0,0 + return math::normalize(float3(0) - convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)); +} + +export float pixel_depth() +[[ + anno::description("Pixel Depth"), + anno::noinline() +]] +{ + return 256.0f; +} + +export float scene_depth() +[[ + anno::description("Scene Depth") +]] +{ + return 65500.0f; +} + +export float3 scene_color() +[[ + anno::description("Scene Color") +]] +{ + return float3(1.0f); +} + +export float4 vertex_color() +[[ + anno::description("Vertex Color"), + anno::noinline() +]] +{ + return float4(1.0f); +} + +export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex) +[[ + anno::description("Vertex Color for float2 PrimVar"), + anno::noinline() +]] +{ + // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead + return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y); +} + +export float3 camera_position() +[[ + anno::description("Camera Position"), + anno::noinline() +]] +{ + return float3(1000.0f, 0, 0); +} + +export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position) +[[ + anno::description("Rotates Position about the given axis by the given angle") +]] +{ + // Project Position onto the rotation axis and find the closest point on the axis to Position + float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z); + float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis); + // Construct orthogonal axes in the plane of the rotation + float3 UAxis = Position - ClosestPointOnAxis; + float3 VAxis = math::cross(NormalizedRotationAxis, UAxis); + float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w); + // Rotate using the orthogonal axes + float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0]; + // Reconstruct the rotated world space position + float3 RotatedPosition = ClosestPointOnAxis + R; + // Convert from position to a position offset + return RotatedPosition - Position; +} + +export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset) +[[ + anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied") +]] +{ + return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset; +} + +export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal, uniform bool up_z = true) +[[ + anno::description("Reflection vector about the specified world space normal") +]] +{ + if (bNormalizeInputNormal) + { + WorldNormal = math::normalize(WorldNormal); + } + + return -camera_vector(up_z) + WorldNormal * math::dot(WorldNormal, camera_vector(up_z)) * 2.0; +} + +export float3 reflection_vector(uniform bool up_z = true) +[[ + anno::description("Reflection Vector"), + anno::noinline() +]] +{ + float3 normal = convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); + return reflection_custom_world_normal(normal, false, up_z); +} + +export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]]) +[[ + anno::description("Dither TemporalAA"), + anno::noinline() +]] +{ + return AlphaThreshold; +} + +export float3 black_body( float Temp ) +[[ + anno::description("Black Body"), + anno::noinline() +]] +{ + float u = ( 0.860117757f + 1.54118254e-4f * Temp + 1.28641212e-7f * Temp*Temp ) / ( 1.0f + 8.42420235e-4f * Temp + 7.08145163e-7f * Temp*Temp ); + float v = ( 0.317398726f + 4.22806245e-5f * Temp + 4.20481691e-8f * Temp*Temp ) / ( 1.0f - 2.89741816e-5f * Temp + 1.61456053e-7f * Temp*Temp ); + + float x = 3*u / ( 2*u - 8*v + 4 ); + float y = 2*v / ( 2*u - 8*v + 4 ); + float z = 1 - x - y; + + float Y = 1; + float X = Y/y * x; + float Z = Y/y * z; + + float3x3 XYZtoRGB = float3x3( + float3(3.2404542, -1.5371385, -0.4985314), + float3(-0.9692660, 1.8760108, 0.0415560), + float3(0.0556434, -0.2040259, 1.0572252) + ); + + return XYZtoRGB * float3( X, Y, Z ) * math::pow( 0.0004 * Temp, 4 ); +} + +export float per_instance_random(uniform texture_2d PerlinNoiseGradientTexture, int NumberInstances) +[[ + anno::description("Per Instance Random"), + anno::noinline() +]] +{ + float weight = state::object_id() / float(NumberInstances); + return NumberInstances == 0 ? 0.0 : tex::lookup_float4(PerlinNoiseGradientTexture, float2(weight, 1.0 - weight), tex::wrap_repeat, tex::wrap_repeat).x; +} + +//------------------ Hair from UE4 ----------------------- +float3 hair_absorption_to_color(float3 A) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::exp(-math::sqrt(A) * D); +} + +float3 hair_color_to_absorption(float3 C) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::pow(math::log(C) / D, 2.0f); +} + +export float3 get_hair_color_from_melanin(float InMelanin, float InRedness, float3 InDyeColor) +[[ + anno::description("Hair Color") +]] +{ + InMelanin = math::saturate(InMelanin); + InRedness = math::saturate(InRedness); + float Melanin = -math::log(math::max(1 - InMelanin, 0.0001f)); + float Eumelanin = Melanin * (1 - InRedness); + float Pheomelanin = Melanin * InRedness; + + float3 DyeAbsorption = hair_color_to_absorption(math::saturate(InDyeColor)); + float3 Absorption = Eumelanin * float3(0.506f, 0.841f, 1.653f) + Pheomelanin * float3(0.343f, 0.733f, 1.924f); + + return hair_absorption_to_color(Absorption + DyeAbsorption); +} + +export float3 local_object_bounds_min() +[[ + anno::description("Local Object Bounds Min"), + anno::noinline() +]] +{ + return float3(0.0); +} + +export float3 local_object_bounds_max() +[[ + anno::description("Local Object Bounds Max"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float3 object_bounds() +[[ + anno::description("Object Bounds"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float object_radius() +[[ + anno::description("Object Radius"), + anno::noinline() +]] +{ + return 100.0f; +} + +export float3 object_world_position(uniform bool up_z = true) +[[ + anno::description("Object World Position"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)*state::meters_per_scene_unit()*100.0; +} + +export float3 object_orientation() +[[ + anno::description("Object Orientation"), + anno::noinline() +]] +{ + return float3(0); +} + +export float rcp(float x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float2 rcp(float2 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float3 rcp(float3 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float4 rcp(float4 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export int BitFieldExtractI32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractI32 int"), + anno::noinline() +]] +{ + Size &= 3; + Offset &= 3; + + if (Size == 0) + return 0; + else if (Offset + Size < 32) + return (Data << (32 - Size - Offset)) >> (32 - Size); + else + return Data >> Offset; +} + +export int BitFieldExtractI32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractI32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(int(Data), int(Size), int(Offset)); +} + +export int BitFieldExtractU32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractU32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export int BitFieldExtractU32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractU32 int"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export float3 EyeAdaptationInverseLookup(float3 LightValue, float Alpha) +[[ + anno::description("EyeAdaptationInverseLookup"), + anno::noinline() +]] +{ + float Adaptation = 1.0f; + + // When Alpha=0.0, we want to multiply by 1.0. when Alpha = 1.0, we want to multiply by 1/Adaptation. + // So the lerped value is: + // LerpLogScale = Lerp(log(1),log(1/Adaptaiton),T) + // Which is simplified as: + // LerpLogScale = Lerp(0,-log(Adaptation),T) + // LerpLogScale = -T * logAdaptation; + + float LerpLogScale = -Alpha * math::log(Adaptation); + float Scale = math::exp(LerpLogScale); + return LightValue * Scale; +} diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/DayMaterial.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/DayMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c799566b1b509c2f02ea4dc7710a06f8dfdf6a1b --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/DayMaterial.mdl @@ -0,0 +1,67 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material DayMaterial( + float Flat = 1.0 + [[ + anno::display_name("Flat"), + anno::ui_order(32) + ]], + uniform texture_2d img = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("img"), + anno::ui_order(32), + sampler_color() + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + + float3 Normal_mdl = float3(0.0,0.0,1.0); + + float4 Local0 = tex::lookup_float4(img,float2(CustomizedUV0_mdl.x,1.0-CustomizedUV0_mdl.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local1 = (Flat * float3(Local0.x,Local0.y,Local0.z)); + + float3 EmissiveColor_mdl = Local1; + float Opacity_mdl = Local0.w; + float OpacityMask_mdl = (math::saturate(Local0.w) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = float3(0.0,0.0,0.0); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = 0.5; + float2 Refraction_mdl = float2(float2(1.0,0.0).x,float2(1.0,0.0).x); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/KooPbr.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/KooPbr.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5e993afd51fcee2e32fb4d95cd3570aff2eb9405 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/KooPbr.mdl @@ -0,0 +1,462 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::anno::*; +import ::df::*; +import ::df::color_weighted_layer; +import ::math::*; +import ::state::*; + +export material KooMtl2Sided( + material frontMtl = material() [[ + anno::in_group("Parameters"), + anno::display_name("Front material") + ]], + material backMtl = frontMtl [[ + anno::in_group("Parameters"), + anno::display_name("Back material") + ]], + uniform bool use_backMtl = false [[ + anno::in_group("Parameters"), + anno::display_name("Use back material") + ]], + color translucency = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Basic parameters"), + anno::display_name("Translucency") + ]], + color front_tint = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Front tint"), + anno::hidden() + ]], + color back_tint = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Back tint"), + anno::hidden() + ]], + uniform bool multiply_by_front_diffuse = false [[ + anno::in_group("Basic parameters"), + anno::display_name("Multiply by front diffuse"), + anno::unused(), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + bsdf transmission_bsdf = + df::diffuse_transmission_bsdf(tint: (front_tint + back_tint)*0.5f); + + bsdf front_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : frontMtl.surface.scattering + ); + + bsdf back_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : backMtl.surface.scattering + ); + } in + material( + thin_walled: true, + ior: frontMtl.ior, + surface: material_surface(scattering: front_bsdf), + backface: material_surface(scattering: use_backMtl ? back_bsdf : front_bsdf), + volume: frontMtl.volume, + geometry: frontMtl.geometry + ); + +float emissive_multiplier() uniform +[[ + anno::description("unit conversion from pbrjson emission to mdl"), + anno::noinline() +]] +{ + return 2560.f; +} + +export material KooLightMtl( + color emission = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Emission") + ]], + uniform float emission_mult = 1.f [[ + anno::in_group("Parameters"), + anno::display_name("Mutliplier") + ]], + color opacity = color(1.f, 1.f, 1.f) [[ + anno::in_group("Parameters"), + anno::display_name("Opacity") + ]], + uniform bool emit_on_backside = false [[ + anno::in_group("Parameters"), + anno::display_name("Emit light on back side") + ]]) +[[ + anno::author("KooLab") +]] + = + let { + color emission_color = (emission*opacity)*emission_mult * emissive_multiplier(); + + bsdf surface_bsdf = + df::simple_glossy_bsdf + ( + mode: df::scatter_transmit, + tint: color(1.f) - opacity, + roughness_u: 0 + ); + + material_surface emit_surface = material_surface( + scattering: surface_bsdf, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: emission_color) + ); + } in + material( + thin_walled: emit_on_backside, + ior: color(1.f), + surface: emit_surface, + backface: emit_on_backside ? emit_surface : material_surface() + ); + +export material KooMtl( + color diffuse = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("diffuse") + ]], + color reflect = color(0.f, 0.f, 0.f) [[ + anno::in_group("Reflections"), + anno::display_name("reflect") + ]], + float reflect_glossiness = 1.f [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool fresnel = true [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float fresnel_ior = 1.6f [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::hard_range(0.2f, 5.f) + ]], + uniform bool fresnel_ior_lock = true [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refract_ior = 1.6f [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool invert_refraction_ior = false [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + color self_illumination = color(0.f, 0.f, 0.f) [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-Illumination Intensity") + ]], + float anisotropy = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + float3 texmap_bump = state::normal() [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float opacity = 1.f [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + uniform bool thin_walled = false [[ + anno::in_group("Options"), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + float reflection_roughness = math::pow((1.f - reflect_glossiness), 2.f); + + float refl_ior = invert_reflection_ior ? 1.f/(fresnel_ior + 0.01f) : fresnel_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refract_ior + 0.01f) : refract_ior; + + float ior = fresnel_ior_lock ? refr_ior : refl_ior; + float R0 = math::pow((1.f - ior)/(1.f + ior), 2.f); + + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse, + roughness : 0.0f + ), + normal : texmap_bump + ); + + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: fresnel ? reflect : color(1.f), + roughness_u: reflection_roughness + ); + + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: diffuse, + roughness_u: reflection_roughness + ); + + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : fresnel ? color(R0) : reflect, + grazing_reflectivity: fresnel ? color(1.f) : reflect, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ); + } in + material + ( + ior : color(refr_ior), + thin_walled : thin_walled, + surface : material_surface + ( + scattering : surface_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry + ( + cutout_opacity: opacity + ) + ); + +export material KooTranslucentMtl( + color diffuse = color(0.5f, 0.5f, 0.5f) [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("Diffuse") + ]], + color reflect = color(0.f, 0.f, 0.f) [[ + anno::in_group("Reflections"), + anno::display_name("Reflect") + ]], + float reflect_glossiness = 1.f [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool fresnel = true [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float fresnel_ior = 1.6f [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::soft_range(0.2, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool fresnel_ior_lock = true [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + color refract = color(0.f, 0.f, 0.f) [[ + anno::in_group("Refractions"), + anno::display_name("Refract") + ]], + float refract_glossiness = 1.f [[ + anno::in_group("Refractions"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refract_ior = 1.6f [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.0e-06f, 100.f) + ]], + uniform bool invert_refraction_ior = false [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + color self_illumination = color(0.f, 0.f, 0.f) [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f [[ + anno::in_group("Self-Illumination"), + anno::display_name("Multiplier") + ]], + float anisotropy = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + float3 texmap_bump = state::normal() [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float texmap_opacity = 1.f [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + uniform bool thin_walled = false [[ + anno::in_group("Options"), + anno::hidden() + ]]) +[[ + anno::author("KooLab") +]] + = + let { + float reflection_roughness = math::pow((1.f - reflect_glossiness), 2.f); + + float refraction_roughness = math::pow((1.f - refract_glossiness), 2.f); + + float refl_ior = invert_reflection_ior ? 1.f/(fresnel_ior + 0.01f) : fresnel_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refract_ior + 0.01f) : refract_ior; + + float ior = fresnel_ior_lock ? refr_ior : refl_ior; + float R0 = math::pow((1.f - ior)/(1.f + ior), 2.f); + + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse, + roughness : 0.f + ), + normal : texmap_bump + ); + + bsdf glossy_transmission_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: color(1.f), + roughness_u: refraction_roughness + ); + + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: fresnel ? reflect : color(1.f), + roughness_u: reflection_roughness + ); + + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: diffuse, + roughness_u: reflection_roughness + ); + + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : fresnel ? color(R0) : reflect, + grazing_reflectivity: fresnel ? color(1.f) : reflect, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : + df::color_weighted_layer + ( + weight : refract, + layer : glossy_transmission_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ), + normal : texmap_bump + ); + } in + material( + thin_walled : thin_walled, + ior : color(refr_ior), + surface : material_surface + ( + scattering : surface_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry(cutout_opacity: texmap_opacity) + ); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_65280158380e0100010b7e80.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_65280158380e0100010b7e80.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fb98ff6de1f9145c4a3eb8852788b32dca817a9b --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_65280158380e0100010b7e80.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_65280158380e0100010b7e80(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.007799999788f, 0.007799999788f, 0.007799999788f), + reflect: color(0.05900000036f, 0.05900000036f, 0.05900000036f), + reflect_glossiness: 0.8999999762f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6528015880db5600018a9fee.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6528015880db5600018a9fee.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3d8c347b999ba7a79898a3513893f571ef657a75 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6528015880db5600018a9fee.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6528015880db5600018a9fee(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.3.7\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.f, 0.f, 0.f), + reflect: color(0.9100000262f, 0.5899999738f, 0.1800000072f), + reflect_glossiness: 0.8999999762f, + fresnel: false, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: true, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6576cd0317d81a00010bf6d5.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6576cd0317d81a00010bf6d5.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f30e4ca3b196d1acc2075745c90ab1873942ada7 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6576cd0317d81a00010bf6d5.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd0317d81a00010bf6d5(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(1.f, 1.f, 1.f), + reflect: color(0.9179999828f, 0.9179999828f, 0.9179999828f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 1.600000024f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6576cd03a9943b0001ca97a3.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6576cd03a9943b0001ca97a3.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0f69d907866914b7172f5b5ad1b80a4fe29ccd45 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6576cd03a9943b0001ca97a3.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd03a9943b0001ca97a3(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,14],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(1.f, 0.992200017f, 0.9804000258f), + reflect: color(0.753000021f, 0.753000021f, 0.753000021f), + reflect_glossiness: 0.8500000238f, + fresnel: true, + fresnel_ior: 2.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6576cd03fa411a000184ef9a.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6576cd03fa411a000184ef9a.mdl new file mode 100644 index 0000000000000000000000000000000000000000..19ecc6ba9b94d87f885028be60b652f16080e380 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/MI_6576cd03fa411a000184ef9a.mdl @@ -0,0 +1,30 @@ +// auto generated by pbrjson2mdl +// version = cc4b850 +mdl 1.6; + +import ::state::normal; +import ::KooPbr::KooMtl; +import ::anno::description; + +export material MI_6576cd03fa411a000184ef9a(*) +[[ + anno::description("{\"status\":0,\"tag\":[0,28],\"version\":\"1.4.0\"}") +]] + = KooPbr::KooMtl( + diffuse: color(0.007799999788f, 0.007799999788f, 0.007799999788f), + reflect: color(0.7300000191f, 0.5299999714f, 0.3199999928f), + reflect_glossiness: 0.8000000119f, + fresnel: true, + fresnel_ior: 5.f, + fresnel_ior_lock: false, + invert_reflection_ior: false, + reflection_metalness: 0.f, + refract_ior: 1.600000024f, + invert_refraction_ior: false, + self_illumination: color(0.f, 0.f, 0.f), + self_illumination_multiplier: 1.f, + anisotropy: 0.f, + anisotropy_rotation: 0.f, + texmap_bump: state::normal(), + opacity: 1.f, + thin_walled: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5acdca7c36f29d7e4539ab50.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5acdca7c36f29d7e4539ab50.mdl new file mode 100644 index 0000000000000000000000000000000000000000..04de54404914df23e7f9c08c2eb57507e9e8db29 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5acdca7c36f29d7e4539ab50.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5acdca7c36f29d7e4539ab50( + uniform texture_2d Normal_Tex = texture_2d("./Textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("./Textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5ba9ffe1ed994627ecfaf1b2.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5ba9ffe1ed994627ecfaf1b2.mdl new file mode 100644 index 0000000000000000000000000000000000000000..10d5bec4d3407b5f8db547322d24ac67c7367911 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5ba9ffe1ed994627ecfaf1b2.mdl @@ -0,0 +1,307 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Translucent import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5ba9ffe1ed994627ecfaf1b2( + uniform texture_2d Normal_Tex = texture_2d("./Textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("./Textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float Opacity = 0.5 + [[ + anno::display_name("Opacity"), + anno::ui_order(32), + anno::in_group("Translucent") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + uniform float SwitchRefraction = 0.0 + [[ + anno::display_name("SwitchRefraction"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + uniform float FresnelB = 1.517 + [[ + anno::display_name("FresnelB"), + anno::ui_order(32), + anno::in_group("Refraction") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + float Local89 = ((math::abs(SwitchRefraction - 1.0) > 0.01) ? (1.0) : FresnelB); + + float3 EmissiveColor_mdl = Local28; + float Opacity_mdl = Opacity; + float OpacityMask_mdl = (math::saturate(Opacity) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + float2 Refraction_mdl = float2(Local89,Local89); + + } in + ::OmniUe4Translucent( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: Opacity_mdl, + opacity_mask: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + refraction: Refraction_mdl.x, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a441fbaf28040302c7aaabfbcf14b24a85bdf643 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl @@ -0,0 +1,224 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - merge unlit template +//* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side +//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - /* flip_tangent_v */ + tangent_v * normal.y + + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Base( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + float clearcoat_weight = 0.0, + float clearcoat_roughness = 0.0, + float3 clearcoat_normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform bool is_tangent_space_normal = true, + uniform bool two_sided = false, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Base"), + anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::saturate(metallic); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_clearcoat_weight = math::saturate(clearcoat_weight); + float final_clearcoat_roughness = math::saturate(clearcoat_roughness); + float3 final_normal = math::normalize(normal); + float3 final_clearcoat_normal = math::normalize(clearcoat_normal); + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color), + normal: the_normal); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + // clearcoat layer + float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0); + float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness; + + float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ); + + + bsdf clearcoat = + df::custom_curve_layer( + base: df::weighted_layer( + layer: dielectric_metal_mix, + weight: 1.0, + normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal + ), + layer: df::microfacet_ggx_smith_bsdf( + roughness_u: clearcoat_alpha, + tint: color(1.0) + ), + normal_reflectivity: 0.04, + grazing_reflectivity: clearcoat_grazing_refl, + normal: the_clearcoat_normal, + weight: final_clearcoat_weight + ); + bsdf surface = is_unlit ? bsdf() : clearcoat; +} +in material( + thin_walled: two_sided, // Graphene? + surface: material_surface( + scattering: surface, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + backface: material_surface( + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + geometry: material_geometry( + displacement: displacement, + normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(), + cutout_opacity: enable_opacity ? opacity : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0801afff6f0870ea2574c9e9b6e2043e79e9a79 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl @@ -0,0 +1,1413 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.1 - using absolute import paths when importing standard modules + +mdl 1.6; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + + +export float3 convert_to_left_hand(float3 vec3, uniform bool up_z = true, uniform bool is_position = true) +[[ + anno::description("convert from RH to LH"), + anno::noinline() +]] +{ + float4x4 ZupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4x4 YupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4 vec4 = float4(vec3.x, vec3.y, vec3.z, is_position ? 1.0f : 0.0f); + + vec4 = vec4 * (up_z ? ZupConversion : YupConversion); + + return float3(vec4.x, vec4.y, vec4.z); +} + +export float3 transform_vector_from_tangent_to_world(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from tangent space to world space"), + anno::noinline() +]] +{ + /* flip_tangent_v */ + return convert_to_left_hand( + tangent_u * vector.x - tangent_v * vector.y + state::normal() * vector.z, + up_z, false); +} + +export float3 transform_vector_from_world_to_tangent(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from world space to tangent space"), + anno::noinline() +]] +{ + float3 vecRH = convert_to_left_hand(vector, up_z, false); + /* flip_tangent_v */ + return vecRH.x * float3(tangent_u.x, -tangent_v.x, state::normal().x) + + vecRH.y * float3(tangent_u.y, -tangent_v.y, state::normal().y) + + vecRH.z * float3(tangent_u.z, -tangent_v.z, state::normal().z); +} + +export float4 unpack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Unpack a normal stored in a normal map"), + anno::noinline() +]] +{ + float2 normal_xy = float2(texture_sample.x, texture_sample.y); + + normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0); + float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) ); + return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 ); +} + +// for get color value from normal. +export float4 pack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Pack to color from a normal") +]] +{ + float2 return_xy = float2(texture_sample.x, texture_sample.y); + + return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0); + + return float4( return_xy.x, return_xy.y, 0.0, 1.0 ); +} + +export float4 greyscale_texture_lookup( + float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0) + ) +[[ + anno::description("Sampling a greyscale texture"), + anno::noinline() +]] +{ + return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x); +} + +export float3 pixel_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Pixel normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 vertex_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Vertex normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 landscape_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Landscape normal in world space") +]] +{ + float3 normalFromNormalmap = math::floor((::vertex_normal_world_space(up_z) * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0; + + float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y); + return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY)))); +} + +// Different implementation specific between mdl and hlsl for smoothstep +export float smoothstep(float a, float b, float l) +{ + if (a < b) + { + return math::smoothstep(a, b, l); + } + else if (a > b) + { + return 1.0 - math::smoothstep(b, a, l); + } + else + { + return l <= a ? 0.0 : 1.0; + } +} + +export float2 smoothstep(float2 a, float2 b, float2 l) +{ + return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y)); +} + +export float3 smoothstep(float3 a, float3 b, float3 l) +{ + return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z)); +} + +export float4 smoothstep(float4 a, float4 b, float4 l) +{ + return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w)); +} + +export float2 smoothstep(float2 a, float2 b, float l) +{ + return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l)); +} + +export float3 smoothstep(float3 a, float3 b, float l) +{ + return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l)); +} + +export float4 smoothstep(float4 a, float4 b, float l) +{ + return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l)); +} + +export float2 smoothstep(float a, float b, float2 l) +{ + return float2(smoothstep(a, b, l.x), smoothstep(a, b, l.y)); +} + +export float3 smoothstep(float a, float b, float3 l) +{ + return float3(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z)); +} + +export float4 smoothstep(float a, float b, float4 l) +{ + return float4(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z), smoothstep(a, b, l.w)); +} + +//------------------ Random from UE4 ----------------------- +float length2(float3 v) +{ + return math::dot(v, v); +} + +float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v) +{ + const float2 ZShear = float2(17.0f, 89.0f); + + float2 OffsetA = v.z * ZShear; + float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f; + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat); + return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0; +} + +float3 SkewSimplex(float3 In) +{ + return In + math::dot(In, float3(1.0 / 3.0f) ); +} +float3 UnSkewSimplex(float3 In) +{ + return In - math::dot(In, float3(1.0 / 6.0f) ); +} + +// 3D random number generator inspired by PCGs (permuted congruential generator) +// Using a **simple** Feistel cipher in place of the usual xor shift permutation step +// @param v = 3D integer coordinate +// @return three elements w/ 16 random bits each (0-0xffff). +// ~8 ALU operations for result.x (7 mad, 1 >>) +// ~10 ALU operations for result.xy (8 mad, 2 >>) +// ~12 ALU operations for result.xyz (9 mad, 3 >>) + +//TODO: uint3 +int3 Rand3DPCG16(int3 p) +{ + // taking a signed int then reinterpreting as unsigned gives good behavior for negatives + //TODO: uint3 + int3 v = int3(p); + + // Linear congruential step. These LCG constants are from Numerical Recipies + // For additional #'s, PCG would do multiple LCG steps and scramble each on output + // So v here is the RNG state + v = v * 1664525 + 1013904223; + + // PCG uses xorshift for the final shuffle, but it is expensive (and cheap + // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps + // + // Feistel ciphers divide the state into separate parts (usually by bits) + // then apply a series of permutation steps one part at a time. The permutations + // use a reversible operation (usually ^) to part being updated with the result of + // a permutation function on the other parts and the key. + // + // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for + // the combination function, and just multiplying the other two parts (no key) for + // the permutation function. + // + // That gives a simple mad per round. + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + + // only top 16 bits are well shuffled + return v >> 16; +} + +// Wraps noise for tiling texture creation +// @param v = unwrapped texture parameter +// @param bTiling = true to tile, false to not tile +// @param RepeatSize = number of units before repeating +// @return either original or wrapped coord +float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize) +{ + return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v; +} + +// Evaluate polynomial to get smooth transitions for Perlin noise +// only needed by Perlin functions in this file +// scalar(per component): 2 add, 5 mul +float4 PerlinRamp(float4 t) +{ + return t * t * t * (t * (t * 6 - 15) + 10); +} + +// Blum-Blum-Shub-inspired pseudo random number generator +// http://www.umbc.edu/~olano/papers/mNoise.pdf +// real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes +// instead, we use a single prime M just small enough not to overflow +// note that the above paper used 61, which fits in a half, but is unusably bad +// @param Integer valued floating point seed +// @return random number in range [0,1) +// ~8 ALU operations (5 *, 3 frac) +float RandBBSfloat(float seed) +{ + float BBS_PRIME24 = 4093.0; + float s = math::frac(seed / BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + return s; +} + +// Modified noise gradient term +// @param seed - random seed for integer lattice position +// @param offset - [-1,1] offset of evaluation point from lattice point +// @return gradient direction (xyz) and contribution (w) from this lattice point +float4 MGradient(int seed, float3 offset) +{ + //TODO uint + int rand = Rand3DPCG16(int3(seed,0,0)).x; + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000); + float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1; + return float4(direction.x, direction.y, direction.z, math::dot(direction, offset)); +} + +// compute Perlin and related noise corner seed values +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = true to return seed values for a repeating noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @param seed000-seed111 = hash function seeds for the eight corners +// @return fractional part of v +struct SeedValue +{ + float3 fv = float3(0); + float seed000 = 0; + float seed001 = 0; + float seed010 = 0; + float seed011 = 0; + float seed100 = 0; + float seed101 = 0; + float seed110 = 0; + float seed111 = 0; +}; + +SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds; + seeds.fv = math::frac(v); + float3 iv = math::floor(v); + + const float3 primes = float3(19, 47, 101); + + if (bTiling) + { // can't algebraically combine with primes + seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize)); + seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize)); + seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize)); + seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize)); + seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize)); + seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize)); + seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize)); + seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize)); + } + else + { // get to combine offsets with multiplication by primes in this case + seeds.seed000 = math::dot(iv, primes); + seeds.seed100 = seeds.seed000 + primes.x; + seeds.seed010 = seeds.seed000 + primes.y; + seeds.seed110 = seeds.seed100 + primes.y; + seeds.seed001 = seeds.seed000 + primes.z; + seeds.seed101 = seeds.seed100 + primes.z; + seeds.seed011 = seeds.seed010 + primes.z; + seeds.seed111 = seeds.seed110 + primes.z; + } + + return seeds; +} + +struct SimplexWeights +{ + float4 Result = float4(0); + float3 PosA = float3(0); + float3 PosB = float3(0); + float3 PosC = float3(0); + float3 PosD = float3(0); +}; + +// Computed weights and sample positions for simplex interpolation +// @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d +SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos) +{ + SimplexWeights weights; + float3 OrthogonalPosFloor = math::floor(OrthogonalPos); + + weights.PosA = OrthogonalPosFloor; + weights.PosB = weights.PosA + float3(1, 1, 1); + + OrthogonalPos -= OrthogonalPosFloor; + + float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z)); + float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z)); + + weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z); + weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z); + + float RG = OrthogonalPos.x - OrthogonalPos.y; + float RB = OrthogonalPos.x - OrthogonalPos.z; + float GB = OrthogonalPos.y - OrthogonalPos.z; + + weights.Result.z = + math::min(math::max(0, RG), math::max(0, RB)) // X + + math::min(math::max(0, -RG), math::max(0, GB)) // Y + + math::min(math::max(0, -RB), math::max(0, -GB)); // Z + + weights.Result.w = + math::min(math::max(0, -RG), math::max(0, -RB)) // X + + math::min(math::max(0, RG), math::max(0, -GB)) // Y + + math::min(math::max(0, RB), math::max(0, GB)); // Z + + weights.Result.y = Smallest; + weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w; + + return weights; +} + +// filtered 3D gradient simple noise (few texture lookups, high quality) +// @param v >0 +// @return random number in the range -1 .. 1 +float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos) +{ + float3 OrthogonalPos = SkewSimplex(EvalPos); + + SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos); + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit) + float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA); + float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB); + float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC); + float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD); + + Weights.PosA = UnSkewSimplex(Weights.PosA); + Weights.PosB = UnSkewSimplex(Weights.PosB); + Weights.PosC = UnSkewSimplex(Weights.PosC); + Weights.PosD = UnSkewSimplex(Weights.PosD); + + float DistanceWeight; + + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight; + + return 32 * (a + b + c + d); +} + +// filtered 3D noise, can be optimized +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize) +{ + bTiling = true; + float3 fv = math::frac(v); + float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize); + float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize); + + const int2 ZShear = int2(17, 89); + + float2 OffsetA = iv0.z * ZShear; + float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset + if (bTiling) // tiling, have to compute from wrapped coordinates + { + OffsetB = iv1.z * ZShear; + } + + // Texture size scale factor + float ts = 1 / 128.0f; + + // texture coordinates for iv0.xy, as offset for both z slices + float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts; + float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts; + + // texture coordinates for iv1.xy, as offset for both z slices + float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates + float2 TexB1 = TexB0 + ts; + if (bTiling) // for tiling, need to compute from wrapped coordinates + { + TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts; + TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts; + } + + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit) + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 A = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 B = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 C = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 D = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 E = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 F = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 G = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 H = PerlinNoiseColor * 2 - 1; + + float a = math::dot(A, fv - float3(0, 0, 0)); + float b = math::dot(B, fv - float3(1, 0, 0)); + float c = math::dot(C, fv - float3(0, 1, 0)); + float d = math::dot(D, fv - float3(1, 1, 0)); + float e = math::dot(E, fv - float3(0, 0, 1)); + float f = math::dot(F, fv - float3(1, 0, 1)); + float g = math::dot(G, fv - float3(0, 1, 1)); + float h = math::dot(H, fv - float3(1, 1, 1)); + + float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0))); + + float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y); + float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y); + + return math::lerp(i, j, Weights.z); +} + +// @return random number in the range -1 .. 1 +// scalar: 6 frac, 31 mul/mad, 15 add, +float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz) +{ + // needs to be the same value when creating the PerlinNoise3D texture + float Extent = 16; + + // last texel replicated and needed for filtering + // scalar: 3 frac, 6 mul + xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1); + + // scalar: 3 frac + float3 uvw = math::frac(xyz); + // = floor(xyz); + // scalar: 3 add + float3 p0 = xyz - uvw; +// float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping) + // scalar: 2*3 add 5*3 mul + float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0)); + float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping + // scalar: 3 add + float3 p = p0 + f; + // scalar: 3 mad + // TODO: need reverse??? + float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset + + // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count) + // scalar: 4 mad, 3 mul, 3 add + float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f; + float d = NoiseSample.w * 255.f - 127; + return math::dot(xyz, n) - d; +} + +// Perlin-style "Modified Noise" +// http://www.umbc.edu/~olano/papers/index.html#mNoise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w; + float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w; + float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w; + float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w; + float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w; + float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w; + float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w; + float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D value noise - used to be incorrectly called Perlin noise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1; + float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1; + float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1; + float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1; + float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1; + float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1; + float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1; + float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D jitter offset within a voronoi noise cell +// @param pos - integer lattice corner +// @return random offsets vector +float3 VoronoiCornerSample(float3 pos, int Quality) +{ + // random values in [-0.5, 0.5] + float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5; + + // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 2x2x2 search + if (Quality <= 2) + { + return math::normalize(noise) * 0.2588; + } + + // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 3x3x3 search + if (Quality == 3) + { + return math::normalize(noise) * 0.3090; + } + + // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search + return noise; +} + +// compare previous best with a new candidate +// not producing point locations makes it easier for compiler to eliminate calculations when they're not needed +// @param minval = location and distance of best candidate seed point before the new one +// @param candidate = candidate seed point +// @param offset = 3D offset to new candidate seed point +// @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position +// @return position (if bDistanceOnly is false) and distance to closest seed point so far +float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly) +{ + if (bDistanceOnly) + { + return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset))); + } + else + { + float newdist = math::dot(offset, offset); + return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist); + } +} + +// 220 instruction Worley noise +float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly) +{ + float3 fv = math::frac(v), fv2 = math::frac(v + 0.5); + float3 iv = math::floor(v), iv2 = math::floor(v + 0.5); + + // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away + float4 mindist = float4(0,0,0,100); + float3 p, offset; + + // quality level 3: do a 3x3x3 search + if (Quality == 3) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 1; ++offset_x) + { + for (offset_y = -1; offset_y <= 1; ++offset_y) + { + for (offset_z = -1; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + + // everybody else searches a base 2x2x2 neighborhood + else + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = 0; offset_x <= 1; ++offset_x) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // quality level 2, do extra set of points, offset by half a cell + if (Quality == 2) + { + // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + } + + // quality level 4: add extra sets of four cells in each direction + if (Quality >= 4) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 2; offset_x += 3) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + // along x axis + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along y axis + p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along z axis + p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + } + } + } + } + + // transform squared distance to real distance + return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w)); +} + +// Coordinates for corners of a Simplex tetrahedron +// Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011 +// @param v = 3D noise argument +// @return 4 corner locations +float4x3 SimplexCorners(float3 v) +{ + // find base corner by skewing to tetrahedral space and back + float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3); + float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6; + float3 f = v - base; + + // Find offsets to other corners (McEwan did this in tetrahedral space, + // but since skew is along x=y=z axis, this works in Euclidean space too.) + float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y); + float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0; + + // four corners + return float4x3(base, base + a1, base + a2, base + 0.5); +} + +// Improved smoothing function for simplex noise +// @param f = fractional distance to four tetrahedral corners +// @return weight for each corner +float4 SimplexSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale))); +} + +// Derivative of simplex noise smoothing function +// @param f = fractional distanc eto four tetrahedral corners +// @return derivative of smoothing function for each corner by x, y and z +float3x4 SimplexDSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + s = -12 * scale + s*(24 * scale - s * 12 * scale); + + return float3x4( + s * float4(f[0][0], f[1][0], f[2][0], f[3][0]), + s * float4(f[0][1], f[1][1], f[2][1], f[3][1]), + s * float4(f[0][2], f[1][2], f[2][2], f[3][2])); +} + +// Simplex noise and its Jacobian derivative +// @param v = 3D noise argument +// @param bTiling = whether to repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3 +// @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w +// J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz) +// J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx +// You can use this to compute the noise, gradient, curl, or divergence: +// float3x4 J = JacobianSimplex_ALU(...); +// float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise +// float3 Grad = J[0].xyz; // gradient of J[0].w +// float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]); +// float Div = J[0][0]+J[1][1]+J[2][2]; +// All of these are confirmed to compile out all unneeded terms. +// So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation. +float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize) +{ + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000); + + // corners of tetrahedron + float4x3 T = SimplexCorners(v); + // TODO: uint3 + int3 rand = int3(0); + float4x3 gvec0 = float4x3(1.0); + float4x3 gvec1 = float4x3(1.0); + float4x3 gvec2 = float4x3(1.0); + float4x3 fv = float4x3(1.0); + float3x4 grad = float3x4(1.0); + + // processing of tetrahedral vertices, unrolled + // to compute gradient at each corner + fv[0] = v - T[0]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize)))); + gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][0] = math::dot(gvec0[0], fv[0]); + grad[1][0] = math::dot(gvec1[0], fv[0]); + grad[2][0] = math::dot(gvec2[0], fv[0]); + + fv[1] = v - T[1]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize)))); + gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][1] = math::dot(gvec0[1], fv[1]); + grad[1][1] = math::dot(gvec1[1], fv[1]); + grad[2][1] = math::dot(gvec2[1], fv[1]); + + fv[2] = v - T[2]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize)))); + gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][2] = math::dot(gvec0[2], fv[2]); + grad[1][2] = math::dot(gvec1[2], fv[2]); + grad[2][2] = math::dot(gvec2[2], fv[2]); + + fv[3] = v - T[3]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize)))); + gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][3] = math::dot(gvec0[3], fv[3]); + grad[1][3] = math::dot(gvec1[3], fv[3]); + grad[2][3] = math::dot(gvec2[3], fv[3]); + + // blend gradients + float4 sv = SimplexSmooth(fv); + float3x4 ds = SimplexDSmooth(fv); + + float3x4 jacobian = float3x4(1.0); + float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major) + jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0])); + float3 vec1 = gvec1*sv + grad[1]*ds; + jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1])); + float3 vec2 = gvec2*sv + grad[2]*ds; + jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2])); + + return jacobian; +} + +// While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes +// floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion. +float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize) +{ + // verified, HLSL compiled out the switch if Function is a constant + switch(Function) + { + case 0: + return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position); + case 1: + return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize); + case 2: + return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position); + case 3: + return GradientNoise3D_ALU(Position, bTiling, RepeatSize); + case 4: + return ValueNoise3D_ALU(Position, bTiling, RepeatSize); + case 5: + return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0; + } + return 0; +} +//---------------------------------------------------------- + +export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize) +[[ + anno::description("Noise"), + anno::noinline() +]] +{ + Position *= Scale; + FilterWidth *= Scale; + + float Out = 0.0f; + float OutScale = 1.0f; + float InvLevelScale = 1.0f / LevelScale; + + int iFunction(Function); + int iQuality(Quality); + int iLevels(Levels); + bool bTurbulence(Turbulence); + bool bTiling(Tiling); + + for(int i = 0; i < iLevels; ++i) + { + // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions) + OutScale *= math::saturate(1.0 - FilterWidth); + + if(bTurbulence) + { + Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale; + } + else + { + Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale; + } + + Position *= LevelScale; + RepeatSize *= LevelScale; + OutScale *= InvLevelScale; + FilterWidth *= LevelScale; + } + + if(!bTurbulence) + { + // bring -1..1 to 0..1 range + Out = Out * 0.5f + 0.5f; + } + + // Out is in 0..1 range + return math::lerp(OutputMin, OutputMax, Out); +} + +// Material node for noise functions returning a vector value +// @param LevelScale usually 2 but higher values allow efficient use of few levels +// @return in user defined range (OutputMin..OutputMax) +export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise"), + anno::noinline() +]] +{ + float4 result = float4(0,0,0,1); + float3 ret = float3(0); + int iQuality = int(Quality); + int iFunction = int(Function); + bool bTiling = Tiling > 0.0; + + float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used + + // verified, HLSL compiled out the switch if Function is a constant + switch (iFunction) + { + case 0: // Cellnoise + ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff; + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 1: // Color noise + ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 2: // Gradient + result = Jacobian[0]; + break; + case 3: // Curl + ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 4: // Voronoi + result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false); + break; + } + return result; +} + +export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise float3 version"), + anno::noinline() +]] +{ + float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize); + return float3(noise.x, noise.y, noise.z); +} + + +// workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view +export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]]) +[[ + anno::description("Fresnel"), + anno::noinline() +]] +{ + return 0.0; +} + +export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]], + bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]], + bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]], + bool clamp_fresnel_dot_product [[anno::unused()]]) +[[ + anno::description("Fresnel Function"), + anno::noinline() +]] +{ + return 0.0; +} + +export float3 camera_vector(uniform bool up_z = true) +[[ + anno::description("Camera Vector"), + anno::noinline() +]] +{ + // assume camera postion is 0,0,0 + return math::normalize(float3(0) - convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)); +} + +export float pixel_depth() +[[ + anno::description("Pixel Depth"), + anno::noinline() +]] +{ + return 256.0f; +} + +export float scene_depth() +[[ + anno::description("Scene Depth") +]] +{ + return 65500.0f; +} + +export float3 scene_color() +[[ + anno::description("Scene Color") +]] +{ + return float3(1.0f); +} + +export float4 vertex_color() +[[ + anno::description("Vertex Color"), + anno::noinline() +]] +{ + return float4(1.0f); +} + +export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex) +[[ + anno::description("Vertex Color for float2 PrimVar"), + anno::noinline() +]] +{ + // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead + return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y); +} + +export float3 camera_position() +[[ + anno::description("Camera Position"), + anno::noinline() +]] +{ + return float3(1000.0f, 0, 0); +} + +export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position) +[[ + anno::description("Rotates Position about the given axis by the given angle") +]] +{ + // Project Position onto the rotation axis and find the closest point on the axis to Position + float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z); + float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis); + // Construct orthogonal axes in the plane of the rotation + float3 UAxis = Position - ClosestPointOnAxis; + float3 VAxis = math::cross(NormalizedRotationAxis, UAxis); + float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w); + // Rotate using the orthogonal axes + float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0]; + // Reconstruct the rotated world space position + float3 RotatedPosition = ClosestPointOnAxis + R; + // Convert from position to a position offset + return RotatedPosition - Position; +} + +export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset) +[[ + anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied") +]] +{ + return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset; +} + +export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal, uniform bool up_z = true) +[[ + anno::description("Reflection vector about the specified world space normal") +]] +{ + if (bNormalizeInputNormal) + { + WorldNormal = math::normalize(WorldNormal); + } + + return -camera_vector(up_z) + WorldNormal * math::dot(WorldNormal, camera_vector(up_z)) * 2.0; +} + +export float3 reflection_vector(uniform bool up_z = true) +[[ + anno::description("Reflection Vector"), + anno::noinline() +]] +{ + float3 normal = convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); + return reflection_custom_world_normal(normal, false, up_z); +} + +export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]]) +[[ + anno::description("Dither TemporalAA"), + anno::noinline() +]] +{ + return AlphaThreshold; +} + +export float3 black_body( float Temp ) +[[ + anno::description("Black Body"), + anno::noinline() +]] +{ + float u = ( 0.860117757f + 1.54118254e-4f * Temp + 1.28641212e-7f * Temp*Temp ) / ( 1.0f + 8.42420235e-4f * Temp + 7.08145163e-7f * Temp*Temp ); + float v = ( 0.317398726f + 4.22806245e-5f * Temp + 4.20481691e-8f * Temp*Temp ) / ( 1.0f - 2.89741816e-5f * Temp + 1.61456053e-7f * Temp*Temp ); + + float x = 3*u / ( 2*u - 8*v + 4 ); + float y = 2*v / ( 2*u - 8*v + 4 ); + float z = 1 - x - y; + + float Y = 1; + float X = Y/y * x; + float Z = Y/y * z; + + float3x3 XYZtoRGB = float3x3( + float3(3.2404542, -1.5371385, -0.4985314), + float3(-0.9692660, 1.8760108, 0.0415560), + float3(0.0556434, -0.2040259, 1.0572252) + ); + + return XYZtoRGB * float3( X, Y, Z ) * math::pow( 0.0004 * Temp, 4 ); +} + +export float per_instance_random(uniform texture_2d PerlinNoiseGradientTexture, int NumberInstances) +[[ + anno::description("Per Instance Random"), + anno::noinline() +]] +{ + float weight = state::object_id() / float(NumberInstances); + return NumberInstances == 0 ? 0.0 : tex::lookup_float4(PerlinNoiseGradientTexture, float2(weight, 1.0 - weight), tex::wrap_repeat, tex::wrap_repeat).x; +} + +//------------------ Hair from UE4 ----------------------- +float3 hair_absorption_to_color(float3 A) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::exp(-math::sqrt(A) * D); +} + +float3 hair_color_to_absorption(float3 C) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::pow(math::log(C) / D, 2.0f); +} + +export float3 get_hair_color_from_melanin(float InMelanin, float InRedness, float3 InDyeColor) +[[ + anno::description("Hair Color") +]] +{ + InMelanin = math::saturate(InMelanin); + InRedness = math::saturate(InRedness); + float Melanin = -math::log(math::max(1 - InMelanin, 0.0001f)); + float Eumelanin = Melanin * (1 - InRedness); + float Pheomelanin = Melanin * InRedness; + + float3 DyeAbsorption = hair_color_to_absorption(math::saturate(InDyeColor)); + float3 Absorption = Eumelanin * float3(0.506f, 0.841f, 1.653f) + Pheomelanin * float3(0.343f, 0.733f, 1.924f); + + return hair_absorption_to_color(Absorption + DyeAbsorption); +} + +export float3 local_object_bounds_min() +[[ + anno::description("Local Object Bounds Min"), + anno::noinline() +]] +{ + return float3(0.0); +} + +export float3 local_object_bounds_max() +[[ + anno::description("Local Object Bounds Max"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float3 object_bounds() +[[ + anno::description("Object Bounds"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float object_radius() +[[ + anno::description("Object Radius"), + anno::noinline() +]] +{ + return 100.0f; +} + +export float3 object_world_position(uniform bool up_z = true) +[[ + anno::description("Object World Position"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)*state::meters_per_scene_unit()*100.0; +} + +export float3 object_orientation() +[[ + anno::description("Object Orientation"), + anno::noinline() +]] +{ + return float3(0); +} + +export float rcp(float x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float2 rcp(float2 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float3 rcp(float3 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float4 rcp(float4 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export int BitFieldExtractI32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractI32 int"), + anno::noinline() +]] +{ + Size &= 3; + Offset &= 3; + + if (Size == 0) + return 0; + else if (Offset + Size < 32) + return (Data << (32 - Size - Offset)) >> (32 - Size); + else + return Data >> Offset; +} + +export int BitFieldExtractI32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractI32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(int(Data), int(Size), int(Offset)); +} + +export int BitFieldExtractU32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractU32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export int BitFieldExtractU32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractU32 int"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export float3 EyeAdaptationInverseLookup(float3 LightValue, float Alpha) +[[ + anno::description("EyeAdaptationInverseLookup"), + anno::noinline() +]] +{ + float Adaptation = 1.0f; + + // When Alpha=0.0, we want to multiply by 1.0. when Alpha = 1.0, we want to multiply by 1/Adaptation. + // So the lerped value is: + // LerpLogScale = Lerp(log(1),log(1/Adaptaiton),T) + // Which is simplified as: + // LerpLogScale = Lerp(0,-log(Adaptation),T) + // LerpLogScale = -T * logAdaptation; + + float LerpLogScale = -Alpha * math::log(Adaptation); + float Scale = math::exp(LerpLogScale); + return LightValue * Scale; +} diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Translucent.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Translucent.mdl new file mode 100644 index 0000000000000000000000000000000000000000..483a83004b8f7d5bf820a7905d06ea2d7d5894af --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Translucent.mdl @@ -0,0 +1,233 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - Emissive color affected by opacity +// - Support opacity mask +//* 1.0.2 - Unlit translucent +//* 1.0.3 - specular bsdf instead of microfacet ggx smith bsdf +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +color get_translucent_tint(color base_color, float opacity) +[[ + anno::description("base color of UE4 translucent"), + anno::noinline() +]] +{ + return math::lerp(color(1.0), base_color, opacity); +} + +// Just for UE4 distilling +float get_translucent_opacity(float opacity) +[[ + anno::noinline() +]] +{ + return opacity; +} + +color get_emissive_intensity(color emissive, float opacity) +[[ + anno::description("emissive color of UE4 translucent"), + anno::noinline() +]] +{ + return emissive * opacity; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - + tangent_v * normal.y + /* flip_tangent_v */ + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Translucent( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float opacity_mask = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform float refraction = 1.0, + uniform bool two_sided = false, + uniform bool is_tangent_space_normal = true, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Translucent"), + anno::description("Omni UE4 Translucent, supports UE4 Translucent shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "translucent")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::min(math::max(metallic, 0.0f), 0.99f); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_opacity = math::saturate(opacity); + float3 final_normal = math::normalize(normal); + + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color)); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + bsdf frosted_bsdf = df::specular_bsdf( + tint: color(1), + mode: df::scatter_reflect_transmit + ); + + bsdf final_mix_bsdf = + is_unlit ? df::specular_bsdf( + tint: get_translucent_tint(base_color: final_base_color, opacity: final_opacity), + mode: df::scatter_reflect_transmit + ) + : df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: dielectric_metal_mix, + weight: get_translucent_opacity(final_opacity)), + df::bsdf_component( + component: frosted_bsdf, + weight: 1.0-get_translucent_opacity(final_opacity)) + ) + ); +} +in material( + thin_walled: two_sided, // Graphene? + ior: color(refraction), //refraction + surface: material_surface( + scattering: final_mix_bsdf, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: get_emissive_intensity(emissive: final_emissive_color, opacity: final_opacity) + ) + ), + + geometry: material_geometry( + displacement: displacement, + normal: the_normal, + cutout_opacity: enable_opacity ? opacity_mask : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/WorldGridMaterial.mdl b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/WorldGridMaterial.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3c7aab22109afff78c0327f69bfa229e2ddcc4d1 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/frame_against_pen_holder/GRSceneUSD_dexterous/task4/Collected_scene/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/WorldGridMaterial.mdl @@ -0,0 +1,75 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material WorldGridMaterial( + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0); + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (CustomizedUV0_mdl / 2.0); + float2 Local1 = (Local0 / 0.05); + float4 Local2 = ::unpack_normal_map(tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_N.png",::tex::gamma_linear),float2(Local1.x,1.0-Local1.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local3 = (float3(Local2.x,Local2.y,Local2.z) * float3(0.3,0.3,1.0)); + + float3 Normal_mdl = Local3; + + float2 Local4 = (CustomizedUV0_mdl * 20.0); + float4 Local5 = tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat); + float Local6 = math::lerp(0.4,1.0,Local5.x); + float Local7 = (1.0 - Local6); + float2 Local8 = (Local0 / 0.1); + float4 Local9 = tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local8.x,1.0-Local8.y),tex::wrap_repeat,tex::wrap_repeat); + float Local10 = math::lerp(Local9.y,1.0,0.0); + float Local11 = math::lerp(Local6,Local7,Local10); + float4 Local12 = tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat); + float Local13 = math::lerp(Local9.y,0.0,0.0); + float Local14 = (Local12.y + Local13); + float Local15 = math::lerp(Local14,0.5,0.5); + float Local16 = math::lerp(0.295,0.66,Local15); + float Local17 = (Local16 * 0.5); + float Local18 = (Local11 * Local17); + float Local19 = math::lerp(0.0,0.5,Local12.y); + float Local20 = math::lerp(0.7,1.0,Local9.y); + float Local21 = math::lerp(Local20,1.0,0.0); + float Local22 = (Local21 * 1.0); + float Local23 = (Local19 + Local22); + float Local24 = math::min(math::max(Local23,0.0),1.0); + + float3 EmissiveColor_mdl = float3(0.0,0.0,0.0); + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = float3(Local18,Local18,Local18); + float Metallic_mdl = 0.0; + float Specular_mdl = 0.5; + float Roughness_mdl = Local24; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/Material__3444.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/Material__3444.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a0fadb0edc3cf68913a49000aadde4242aada3d2 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/Material__3444.mdl @@ -0,0 +1,67 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::in_group; +import ::anno::key_words; +import ::anno::version; +import ::base::mono_mode; +import ::tex::gamma_mode; + +export material Material__3444(*) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base", false), + anno::version(2, 1, 2, ""), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = OmniPBR::OmniPBR( + diffuse_color_constant: color(0.5f, 0.5f, 0.5f), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(0.f, 0.f, 0.f), + emissive_color_texture: texture_2d(), + emissive_mask_texture: texture_2d(), + emissive_intensity: 3250.f, + enable_opacity: false, + opacity_texture: texture_2d(), + opacity_constant: 1.f, + enable_opacity_texture: false, + opacity_mode: base::mono_average, + opacity_threshold: 0.00100000005f, + geometry_normal_roughness_strength: 1.f, + bump_factor: 0.300000012f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + flip_tangent_u: false, + flip_tangent_v: true, + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/Material__362.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/Material__362.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e7b531625fbc4e966b2d3a8799322e76bf978ced --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/Material__362.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__362() +[[ + anno::display_name("Material__362") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.74902,0.74902,0.74902), + diffuse_roughness : 0.0f, + Reflection : color(0.67451,0.67451,0.67451), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a01___Default1.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a01___Default1.mdl new file mode 100644 index 0000000000000000000000000000000000000000..da5c29f51df18f52e75fd2bf43a129cdfa50eca1 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a01___Default1.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a01___Default1() +[[ + anno::display_name("_01___Default1") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.882353,0.882353,0.882353), + diffuse_roughness : 0.0f, + Reflection : color(0.0313726,0.0313726,0.0313726), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13343.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13343.mdl new file mode 100644 index 0000000000000000000000000000000000000000..eeff78a98d151f86a81dbc9b0e701bd51a1fb6e0 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13343.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a13343() +[[ + anno::display_name("_13343") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.866667,0.866667,0.866667), + diffuse_roughness : 0.0f, + Reflection : color(0.0392157,0.0392157,0.0392157), + reflection_glossiness : 0.8f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13344.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13344.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8059a386d93bce38dd0291ffb852e2d005491054 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13344.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a13344() +[[ + anno::display_name("_13344") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.788235,0.788235,0.788235), + diffuse_roughness : 0.0f, + Reflection : color(0.0392157,0.0392157,0.0392157), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13367.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13367.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c945a2f6636bbb41fbe97c312e60983560d99ffb --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13367.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a13367() +[[ + anno::display_name("_13367") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.980392,0.980392,0.980392), + diffuse_roughness : 0.0f, + Reflection : color(0.105882,0.105882,0.105882), + reflection_glossiness : 0.9f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13383.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13383.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9cc05fb2d4e6d69ae3aa0ea48dad7be0852e45dd --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13383.mdl @@ -0,0 +1,67 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::in_group; +import ::anno::key_words; +import ::anno::version; +import ::base::mono_mode; +import ::tex::gamma_mode; + +export material a13383(*) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base", false), + anno::version(2, 1, 2, ""), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = OmniPBR::OmniPBR( + diffuse_color_constant: color(0.5f, 0.5f, 0.5f), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(0.f, 0.f, 0.f), + emissive_color_texture: texture_2d(), + emissive_mask_texture: texture_2d(), + emissive_intensity: 3250.f, + enable_opacity: false, + opacity_texture: texture_2d(), + opacity_constant: 1.f, + enable_opacity_texture: false, + opacity_mode: base::mono_average, + opacity_threshold: 0.00100000005f, + geometry_normal_roughness_strength: 1.f, + bump_factor: 0.300000012f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + flip_tangent_u: false, + flip_tangent_v: true, + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13422.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13422.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3fa1b9a092053a175b37cda01fab220b2eda1f67 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13422.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a13422() +[[ + anno::display_name("_13422") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.5,0.5,0.5), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13459.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13459.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8f0d954440505360cf5e5816b4a22b0f62cf5db2 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13459.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a13459() +[[ + anno::display_name("_13459") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.356863,0.0,0.0), + diffuse_roughness : 0.0f, + Reflection : color(0.0901961,0.0901961,0.0901961), + reflection_glossiness : 0.8f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13480.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13480.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ec206e3a4102a198e156632dae794a0ee153eb4a --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13480.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a13480() +[[ + anno::display_name("_13480") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0862745,0.14902,0.137255), + diffuse_roughness : 0.0f, + Reflection : color(0.847059,0.847059,0.847059), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.941177,0.960784,0.952941), + refraction_glossiness : 1.0f, + refraction_ior : 1.517f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13490.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13490.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2eafd6650d0ded8b794686992e518b8adfcc68f4 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13490.mdl @@ -0,0 +1,96 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a13490() +[[ + anno::display_name("_13490") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.25098,0.25098,0.25098), + diffuse_roughness : 0.0f, + Reflection : color(0.560784,0.560784,0.560784), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.65f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_noise_bump( + color1 : color(0.0,0.0,0.0), + color2 : color(1.0,1.0,1.0), + size : 100.0f, + phase : 0.0f, + levels : 3.0f, + thresholdLow : 0.4f, + thresholdHigh : 0.6f, + type : 0, + blur : 1.0f, + offset : float3(0.0f,0.0f,0.0f), + tiling : float3(0.01f,200.0f,0.01f), + angle : float3(0.0f,0.0f,0.0f), + blur_Offset : 0.0f, + coordType : 0, + mapChannel : 1, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.05f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13521.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13521.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a1e6913c8c43be393f815d3219f891bda605fe46 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13521.mdl @@ -0,0 +1,67 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::in_group; +import ::anno::key_words; +import ::anno::version; +import ::base::mono_mode; +import ::tex::gamma_mode; + +export material a13521(*) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base", false), + anno::version(2, 1, 2, ""), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = OmniPBR::OmniPBR( + diffuse_color_constant: color(0.5f, 0.5f, 0.5f), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(0.f, 0.f, 0.f), + emissive_color_texture: texture_2d(), + emissive_mask_texture: texture_2d(), + emissive_intensity: 3250.f, + enable_opacity: false, + opacity_texture: texture_2d(), + opacity_constant: 1.f, + enable_opacity_texture: false, + opacity_mode: base::mono_average, + opacity_threshold: 0.00100000005f, + geometry_normal_roughness_strength: 1.f, + bump_factor: 0.300000012f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + flip_tangent_u: false, + flip_tangent_v: true, + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13522.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13522.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9dc59c0a085e8c6d531700d7607fc5a6670ccf15 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13522.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a13522() +[[ + anno::display_name("_13522") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.788235,0.788235,0.788235), + diffuse_roughness : 0.0f, + Reflection : color(0.0392157,0.0392157,0.0392157), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13530.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13530.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2aec99269a99ca4d4b1541cb9102e524131a6cd5 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a13530.mdl @@ -0,0 +1,97 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a13530() +[[ + anno::display_name("_13530") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./a13530/13326.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a_________________5.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a_________________5.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ba392390d6e937111941377f3f0018288c1175ae --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/a_________________5.mdl @@ -0,0 +1,67 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::in_group; +import ::anno::key_words; +import ::anno::version; +import ::base::mono_mode; +import ::tex::gamma_mode; + +export material a_________________5(*) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base", false), + anno::version(2, 1, 2, ""), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = OmniPBR::OmniPBR( + diffuse_color_constant: color(0.5f, 0.5f, 0.5f), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(0.f, 0.f, 0.f), + emissive_color_texture: texture_2d(), + emissive_mask_texture: texture_2d(), + emissive_intensity: 3250.f, + enable_opacity: false, + opacity_texture: texture_2d(), + opacity_constant: 1.f, + enable_opacity_texture: false, + opacity_mode: base::mono_average, + opacity_threshold: 0.00100000005f, + geometry_normal_roughness_strength: 1.f, + bump_factor: 0.300000012f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + flip_tangent_u: false, + flip_tangent_v: true, + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/baiseyouqi1.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/baiseyouqi1.mdl new file mode 100644 index 0000000000000000000000000000000000000000..eb0768d2e8a507e376795515c77e8b94b88ac62d --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/baiseyouqi1.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material baiseyouqi1() +[[ + anno::display_name("baiseyouqi1") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.776471,0.788235,0.741176), + diffuse_roughness : 0.0f, + Reflection : color(0.176471,0.176471,0.176471), + reflection_glossiness : 0.85f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/black_main1.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/black_main1.mdl new file mode 100644 index 0000000000000000000000000000000000000000..20197dcc0a15df5a69cc7878157bdc1f85422ecd --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/black_main1.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material black_main1() +[[ + anno::display_name("black_main1") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0,0.0,0.0), + diffuse_roughness : 0.5f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0,0.0,0.0), mono:1), + color2 : base::texture_return(tint:color(0.454902,0.454902,0.454902), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Fresnel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.8f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/mozhi.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/mozhi.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c0ba571be06f6fd6aaee0f288c031ed7bbac57c6 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/mozhi.mdl @@ -0,0 +1,104 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material mozhi() +[[ + anno::display_name("mozhi") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./mozhi/13318.jpeg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0,0.0,0.0), mono:1), + color2 : base::texture_return(tint:color(1.0,1.0,1.0), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Fresnel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.85f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/screen.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/screen.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3e042b2a6af518f8667e7a38aad54baafd40871f --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/screen.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material screen() +[[ + anno::display_name("screen") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.282353,0.321569,0.282353), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0,0.0,0.0), mono:1), + color2 : base::texture_return(tint:color(1.0,1.0,1.0), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Fresnel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.95f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/sun_batary.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/sun_batary.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e5026571d1b6fdf38c3253691420a84a9c854e30 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/sun_batary.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material sun_batary() +[[ + anno::display_name("sun_batary") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0196078,0.00784314,0.0156863), + diffuse_roughness : 0.0f, + Reflection : color(1.0,1.0,1.0), + reflection_glossiness : 0.95f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/ad_3dsmax_maps.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/ad_3dsmax_maps.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2335faa6461beac39ae2c5235c9285b2b0cb8596 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/ad_3dsmax_maps.mdl @@ -0,0 +1,4128 @@ +// Copyright 2023 NVIDIA Corporation. All rights reserved. +// +// NVIDIA CORPORATION and its licensors retain all intellectual property +// and proprietary rights in and to this software, related documentation +// and any modifications thereto. Any use, reproduction, disclosure or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA CORPORATION is strictly prohibited. + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::limits::*; +import ::math::*; +import ::state::*; +import ::tex::*; + +export using ::base import color_layer_mode; +export using ::base import texture_return; + +// Helper functions +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +{ + 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) +{ + return state::texture_tangent_u(0) * n.x + + state::texture_tangent_v(0) * n.y + + state::normal() * n.z ; +} + +// Returns a normal as a weighted combination of two normals. +export float3 combine_normals( + float w1 = 1.f, float3 n1 = state::normal(), + float w2 = 1.f, float3 n2 = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n1_t = transform_internal_to_tangent(n1); + float3 n2_t = transform_internal_to_tangent(n2); + + n1_t = math::lerp(float3(0.f, 0.f, 1.f), n1_t, w1); + n2_t = math::lerp(float3(0.f, 0.f, 1.f), n2_t, w2); + + n1_t = n1_t + float3(0.f, 0.f, 1.f); + n2_t = n2_t * float3(-1.f, -1.f, 1.f); + + float3 n = n1_t*math::dot(n1_t, n2_t)/n1_t.z - n2_t; + + // alternative way of combining the 2 normals + // float3 n = float3(n1_t.x + n2_t.x,n1_t.y + n2_t.y, n1_t.z*n2_t.z); + + return math::normalize(transform_tangent_to_internal(n)); +} + +// 3dsmax Bitmap Transformation Matrix +uniform float4x4 max_rotation_translation_scale +( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]], + uniform bool u_mirror = false + [[ anno::description("Mirror repeat has twice the number of textures in the same space") ]], + uniform bool v_mirror = false + [[ anno::description("Mirror repeat has twice the number of textures in the same space") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale") +]] +{ + float4x4 scale = + float4x4(u_mirror?scaling.x*2.:scaling.x , 0. , 0. , 0., + 0. , v_mirror?scaling.y*2.:scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + u_mirror?1.:.5 , v_mirror?1.:.5 , .5 , 1.); + + float4x4 translate = + float4x4(1. , 0. , 0. , 0., + 0. , 1. , 0. , 0., + 0. , 0. , 1. , 0., + -0.5-translation.x, -0.5-translation.y, -0.5-translation.z, 1.); + + + // Euler rotation matrix xyz order + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , c.y*s.z , -s.y , 0.0, + -c.x*s.z + s.x*s.y*c.z, c.x*c.z + s.x*s.y*s.z , s.x*c.y , 0.0, + s.x*s.z + c.x*s.y*c.z , -s.x*c.z + c.x*s.y*s.z, c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + return scale *rotate*translate; +} + +// 3dsmax Mono Output +export enum ad_3dsmax_mono_output +[[ + anno::hidden() +]] +{ + mono_output_rgb_intensity, + mono_output_alpha +}; + +// 3dsmax RGB Output +export enum ad_3dsmax_rgb_output +[[ + anno::hidden() +]] +{ + rgb_output_rgb, + rgb_output_alpha +}; + +// 3dsmax Alpha Source +export enum ad_3dsmax_alpha_source +[[ + anno::hidden() +]] +{ + alpha_source_alpha, + alpha_source_rgb_intensity, + alpha_source_none +}; + +// 3dsmax Bitmap map +export texture_return ad_3dsmax_bitmap +( + uniform int mapChannel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform bool U_Tile=true //it is actually an error if both mirror and tile are true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile") + ]], + uniform bool U_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile") + ]], + uniform bool V_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle") + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused(), + anno::hidden() + ]], + uniform texture_2d filename = texture_2d() + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bitmap") + ]], + uniform float clipu = 0.f //u+w and v+h are always <=1.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("U Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipw = 1.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("W Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipv = 0.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("V Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float cliph = 1.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("H Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform ad_3dsmax_mono_output mono_output = mono_output_rgb_intensity + [[ + anno::in_group("Mono Output"), + anno::display_name("Mono Output") + ]], + uniform ad_3dsmax_rgb_output rgb_output = rgb_output_rgb + [[ + anno::in_group("RGB Output"), + anno::display_name("RGB Output") + ]], + uniform ad_3dsmax_alpha_source alpha_source = alpha_source_none + [[ + anno::in_group("Alpha Source"), + anno::display_name("Alpha Source") + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output amount") + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB level") + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + texture_return result = base::file_texture + ( + texture: filename, + mono_source: (alpha_source == alpha_source_alpha) ? base::mono_alpha : base::mono_average, + crop_u: float2(clipu, clipw+clipu), + crop_v: float2(1.-clipv-cliph, 1.-clipv), + uvw: base::transform_coordinate( + transform: max_rotation_translation_scale( + scaling: float3(U_Tiling,V_Tiling,1.0), + rotation: float3(U_angle,V_angle,W_angle)/180.*math::PI, + translation: float3(U_Offset,V_Offset,0.0),u_mirror: U_Mirror,v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: mapChannel-1) + ), + wrap_u: U_Tile?tex::wrap_repeat:U_Mirror?tex::wrap_mirrored_repeat:tex::wrap_clip, + wrap_v: V_Tile?tex::wrap_repeat:V_Mirror?tex::wrap_mirrored_repeat:tex::wrap_clip + ); + + result.tint = invert ? result.tint * (-rgb_level * output_amount ) + (1.f - rgb_offset) : result.tint * (rgb_level * output_amount ) + rgb_offset; + + float alpha = (alpha_source != alpha_source_none) ? result.mono : 1.f; + result.tint = result.tint*alpha; + + // determinate mono output + if(mono_output == mono_output_alpha) + result.mono = alpha; + else + result.mono = math::average(result.tint); + + // determinate rgb output + if(rgb_output == rgb_output_alpha) + result.tint = color(alpha); + + return result; +} +// 3dsmax Bitmap Map for Bump +export float3 ad_3dsmax_bitmap_bump +( + uniform int mapChannel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform bool U_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile") + ]], + uniform bool U_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile") + ]], + uniform bool V_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1. + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused() + ]], + uniform texture_2d filename = texture_2d() + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bitmap") + ]], + uniform float clipu = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("U Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipw = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("W Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipv = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("V Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float cliph = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("H Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float factor = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bump amount") + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump output") + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB intensity"), + anno::unused() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output amount"), + anno::unused() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB level"), + anno::unused() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return base::file_bump_texture + ( + texture : filename, + crop_u : float2(clipu, clipw + clipu), + crop_v : float2(1.f - clipv - cliph, 1.f - clipv), + uvw : base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling : float3(U_Tiling, V_Tiling, 1.f), + rotation : float3(U_angle, V_angle, W_angle)/(180.f*math::PI), + translation : float3(U_Offset, V_Offset, 0.f), + u_mirror : U_Mirror, + v_mirror : V_Mirror + ), + coordinate: base::coordinate_source(texture_space: mapChannel - 1) + ), + wrap_u : U_Tile ? tex::wrap_repeat : U_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + wrap_v : V_Tile ? tex::wrap_repeat : V_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + factor : invert ? -10.f*factor*bump_amount : 10.f*factor*bump_amount + ); +} + +// 3dsmax Bitmap Normal Map +export float3 ad_3dsmax_bitmap_normalmap +( + uniform int mapChannel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform bool U_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile") + ]], + uniform bool U_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile") + ]], + uniform bool V_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW type"), + anno::unused() + ]], + uniform texture_2d filename = texture_2d() + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bitmap") + ]], + uniform float clipu = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("U Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipw = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("W Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipv = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("V Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float cliph = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("H Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float factor = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Strength") + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump Amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output Amount") + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB level") + ]], + uniform float rgb_offset = 0.0 + [[ + anno::in_group("Output"), + anno::display_name("RGB offset"), + anno::unused(), + anno::hidden() + ]], + uniform float mult_spin = 1.f + [[ + anno::in_group("Parameters"), + anno::display_name("Normal map mult") + ]], + uniform bool swap_rg = false + [[ + anno::in_group("Parameters"), + anno::display_name("Swap red & green"), + anno::unused(), + anno::hidden() + ]], + uniform bool flipred = false + [[ + anno::in_group("Parameters"), + anno::display_name("Flip red") + ]], + uniform bool flipgreen = false + [[ + anno::in_group("Parameters"), + anno::display_name("Flip green") + ]], + + uniform int method = 0 + [[ + anno::in_group("Parameters"), + anno::display_name("Method"), + anno::unused(), + anno::hidden() + ]], + float3 bump_map = state::normal() + [[ + anno::in_group("Parameters"), + anno::display_name("Bump map"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return base::tangent_space_normal_texture( + texture: filename, + crop_u: float2(clipu, clipw + clipu), + crop_v: float2(1.f - clipv - cliph, 1.f - clipv), + factor: factor*mult_spin*rgb_level*output_amount, + flip_tangent_u: invert ? !flipred : flipred, + flip_tangent_v: invert ? flipgreen : !flipgreen, + uvw: base::transform_coordinate( + transform: max_rotation_translation_scale( + scaling: float3(U_Tiling, V_Tiling, 1.f), + rotation: float3(U_angle, V_angle, W_angle)/180.f*math::PI , + translation: float3(U_Offset, V_Offset, 0.f), + u_mirror: U_Mirror, + v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: mapChannel - 1) + ), + wrap_u: U_Tile ? tex::wrap_repeat : U_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + wrap_v: V_Tile ? tex::wrap_repeat : V_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip + ); +} + +// 3dsmax Color Correction RGB Channels +export enum ad_3dsmax_channel +[[ + anno::hidden() +]] +{ + channel_red, + channel_green, + channel_blue, + channel_alpha, + channel_inverse_red, + channel_inverse_green, + channel_inverse_blue, + channel_inverse_alpha, + channel_mono, + channel_one, + channel_zero +}; + +// 3dsmax Color Correction Lightness Mode +export enum ad_3dsmax_lightness_mode +[[ + anno::hidden() +]] +{ + Standard, + Advanced +}; + +// 3dsmax Color Correction Map +export texture_return ad_3dsmax_color_correction +( + texture_return map = texture_return() + [[ + anno::in_group("Basic parameters"), + anno::display_name("Color") + ]], + uniform ad_3dsmax_channel rewireR = channel_red + [[ + anno::in_group("Channels"), + anno::display_name("Red") + ]], + uniform ad_3dsmax_channel rewireG = channel_green + [[ + anno::in_group("Channels"), + anno::display_name("Green") + ]], + uniform ad_3dsmax_channel rewireB = channel_blue + [[ + anno::in_group("Channels"), + anno::display_name("Blue") + ]], + uniform ad_3dsmax_channel rewireA = channel_alpha + [[ + anno::in_group("Channels"), + anno::display_name("Alpha") + ]], + uniform float hue_shift = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Hue shift"), + anno::hard_range(-180.f, 180.f) + ]], + uniform float saturation = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Saturation"), + anno::hard_range(-100.f, 100.f) + ]], + uniform float hue_tint = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Hue tint"), + anno::hard_range(0.f, 360.f) + ]], + uniform float hue_tint_amnt = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Strength"), + anno::hard_range(0.f, 100.f) + ]], + uniform ad_3dsmax_lightness_mode lightness_mode = Standard + [[ + anno::in_group("Lightness"), + anno::display_name("Lightness mode") + ]], + uniform float brightness = 0.f + [[ + anno::in_group("Lightness"), + anno::display_name("Brightness"), + anno::hard_range(-100.f, 100.f) + ]], + uniform float contrast = 0.f + [[ + anno::in_group("Lightness"), + anno::display_name("Contrast"), + anno::hard_range(-100.f, 100.f) + ]], + uniform float rgb_gamma = 1.f + [[ + anno::in_group("Lightness"), + anno::display_name("RGB gamma"), + anno::hard_range(0.01f, 10000.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + // channel rewiring + float3 rgb = float3(map.tint); + texture_return result = (rewireB == channel_blue) && (rewireG == channel_green) && (rewireR == channel_red) && (rewireA == channel_alpha) ? + texture_return(color(rgb), map.mono) : + texture_return(color( + rewireR == channel_red ? rgb.x : + rewireR == channel_green ? rgb.y : + rewireR == channel_blue ? rgb.z : + rewireR == channel_alpha ? map.mono : + rewireR == channel_inverse_red ? 1.f - rgb.x : + rewireR == channel_inverse_green ? 1.f - rgb.y : + rewireR == channel_inverse_blue ? 1.f - rgb.z : + rewireR == channel_inverse_alpha ? 1.f - map.mono : + rewireR == channel_mono ? math::luminance(map.tint) : + rewireR == channel_one ? 1.f : 0.f, + rewireG == channel_red ? rgb.x : + rewireG == channel_green ? rgb.y : + rewireG == channel_blue ? rgb.z : + rewireG == channel_alpha ? map.mono : + rewireG == channel_inverse_red ? 1.f - rgb.x : + rewireG == channel_inverse_green ? 1.f - rgb.y : + rewireG == channel_inverse_blue ? 1.f - rgb.z : + rewireG == channel_inverse_alpha ? 1.f - map.mono : + rewireG == channel_mono ? math::luminance(map.tint) : + rewireG == channel_one ? 1.f : 0.f, + rewireB == channel_red ? rgb.x : + rewireB == channel_green ? rgb.y : + rewireB == channel_blue ? rgb.z : + rewireB == channel_alpha ? map.mono : + rewireB == channel_inverse_red ? 1.f - rgb.x : + rewireB == channel_inverse_green ? 1.f - rgb.y : + rewireB == channel_inverse_blue ? 1.f - rgb.z : + rewireB == channel_inverse_alpha ? 1.f - map.mono : + rewireB == channel_mono ? math::luminance(map.tint) : + rewireB == channel_one ? 1.f : 0.f + ), + rewireA == channel_red ? rgb.x : + rewireA == channel_green ? rgb.y : + rewireA == channel_blue ? rgb.z : + rewireA == channel_alpha ? map.mono : + rewireA == channel_inverse_red ? 1.f - rgb.x : + rewireA == channel_inverse_green ? 1.f - rgb.y : + rewireA == channel_inverse_blue ? 1.f - rgb.z : + rewireA == channel_inverse_alpha ? 1.f - map.mono : + rewireA == channel_mono ? math::luminance(map.tint) : + rewireA == channel_one ? 1.f : 0.f); + + rgb = float3(result.tint); + + // chroma correction + if(hue_shift != 0.f || saturation != 0.f || hue_tint_amnt != 0.f) + { + // RGB to HSV + float min = math::min_value(rgb); + float max = math::max_value(rgb); + float h = 0.f, s = 0.f, v = max; + float delta = max - min; + + if(min != max) + { + if(max == rgb.x) + h = math::fmod(((60.f*((rgb.y - rgb.z)/delta)) + 360.f), 360.f); + else if(max == rgb.y) + h = math::fmod(((60.f*((rgb.z - rgb.x)/delta)) + 120.f), 360.f); + else // max == rgb.z + h = math::fmod(((60.f*((rgb.x - rgb.y)/delta)) + 240.f), 360.f); + } + + if(max > 0.f) + { + s = delta / max; + + if(saturation >= 0.f) + s += saturation*saturation*0.0001f; + else + s -= saturation*saturation*0.0001f; + + if(s < 0.f) + s = 0.f; + else if (s > 1.f) + s = 1.f; + } + + // apply cromatic corrections + h += hue_shift; + h += (hue_tint - h)*(hue_tint_amnt*0.01f); + + if(h < 0.f) + h += 360.f; + else if(h >= 360.f) + h -= 360.f; + + + // HSV to RGB + float sv = s*v; + h = math::fmod(h / 60.f, 6.f); + int idx = int(h); + float x = sv * (1.f - math::abs(math::fmod(h, 2.f) - 1.f)); + float m = v - sv; + + float r=0.f, g=0.f, b=0.f; + + switch(idx) + { + case 0: + r = sv, g = x; + break; + case 1: + r = x, g = sv; + break; + case 2: + g = sv, b = x; + break; + case 3: + g = x, b = sv; + break; + case 4: + r = x, b = sv; + break; + case 5: + r = sv, b = x; + break; + } + + rgb = float3(r+m, g+m, b+m); + } + + // lightness correction + if(lightness_mode == Advanced) // advanced exposure + { + if(rgb_gamma != 1.f) + rgb = math::pow(rgb, 1.f/rgb_gamma); + } + else // basic exposure + { + if(contrast != 0.f) + { + float c = contrast*2.55f; + float f = (259.f * (c + 255.f))/(255.f * (259.f - c)); + float3 grey(0.5f); + rgb = math::clamp((rgb - grey)*f + grey, 0.f, 1.f); + } + + if(brightness != 0.f) + { + rgb = math::clamp(rgb + float3(brightness*0.01), 0.f, 1.f); + } + } + + result.tint = color(rgb); + return result; +} + +// 3dsmax Color Correction Map for Bump +export float3 ad_3dsmax_color_correction_bump( + float3 map = state::normal() + [[ + anno::in_group("Basic parameters"), + anno::display_name("Bump map") + ]], + uniform ad_3dsmax_channel rewireR = channel_red + [[ + anno::in_group("Channels"), + anno::display_name("Red"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_channel rewireG = channel_green + [[ + anno::in_group("Channels"), + anno::display_name("Green"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_channel rewireB = channel_blue + [[ + anno::in_group("Channels"), + anno::display_name("Blue"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_channel rewireA = channel_alpha + [[ + anno::in_group("Channels"), + anno::display_name("Alpha"), + anno::unused(), + anno::hidden() + ]], + uniform float hue_shift = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Hue shift"), + anno::hard_range(-180.f, 180.f), + anno::unused(), + anno::hidden() + ]], + uniform float saturation = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Saturation"), + anno::hard_range(-100.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform float hue_tint = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Hue tint"), + anno::hard_range(0.f, 360.f), + anno::unused(), + anno::hidden() + ]], + uniform float hue_tint_amnt = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Strength"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_lightness_mode lightness_mode = Standard + [[ + anno::in_group("Lightness"), + anno::display_name("Lightness mode"), + anno::unused(), + anno::hidden() + ]], + uniform float brightness = 0.f + [[ + anno::in_group("Lightness"), + anno::display_name("Brightness"), + anno::hard_range(-100.f, 100.f), + anno::unused(), + anno::hidden() + + ]], + uniform float contrast = 0.f + [[ + anno::in_group("Lightness"), + anno::display_name("Contrast"), + anno::hard_range(-100.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_gamma = 1.f + [[ + anno::in_group("Lightness"), + anno::display_name("RGB gamma"), + anno::hard_range(0.01f, 10000.f), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Bump"), + anno::display_name("Bump amount"), + anno::hard_range(0.f, 1.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return math::normalize(math::lerp(state::normal(), map, bump_amount)); + // return combine_normals(bump_amount, map, 1.f - bump_amount, state::normal()); + + // EXPERIMENTAL CODE + // if(bump_amount <= 0.f) + // return state::normal(); + + // // normal xyz to spherical + // float disc = math::sqrt(map.x*map.x + map.y*map.y); + // float theta = math::atan(disc/map.z); + // float phi = math::atan2(map.y, map.x); + + // float t = math::clamp(1.f - theta/math::HALF_PI, 0.f, 1.f); // [0, PI/2] --> [1, 0] mapping + + + // // lightness corrections + // if(lightness_mode = Advanced) + // { + // if(rgb_gamma != 1.f) + // t = math::pow(t, 1.f/rgb_gamma); + // } + // else // basic exposure + // { + // if(contrast != 0.f) + // { + // float c = contrast*2.55f; + // float f = (259.f * (c + 255.f))/(255.f * (259.f - c)); + // t = math::clamp((t - 0.5f)*f + 0.5f, 0.f, 1.f); + // } + + // if(brightness != 0.f) + // { + // t = math::clamp(t + (brightness*0.01), 0.f, 1.f); + // } + // } + + // theta = (1.f - t)*math::HALF_PI; // [1, 0] --> [0, PI/2] mapping + + // // normal spherical to xyz + // float3 bump_normal(math::sin(theta)*math::cos(phi), math::sin(theta)*math::sin(phi), math::cos(theta)); + + // if(bump_amount >= 1.f) + // return bump_normal; + // else + // return combine_normals(bump_amount, bump_normal, 1.f - bump_amount, state::normal()); +} + +// 3dsmax Composite Layer Mask Mode +uniform color_layer_mode ad_3dsmax_mapmode(uniform int m) +{ + return + m == 0 ? base::color_layer_blend: + m == 1 ? base::color_layer_average: + m == 2 ? base::color_layer_add: + m == 3 ? base::color_layer_add: //but factor is negative to get subtract!! + m == 4 ? base::color_layer_darken: + m == 5 ? base::color_layer_multiply: + m == 6 ? base::color_layer_colorburn: + m == 7 ? base::color_layer_linearburn: + m == 8 ? base::color_layer_lighten: + m == 9 ? base::color_layer_screen: + m == 10 ? base::color_layer_colordodge: + m == 11 ? base::color_layer_lineardodge: + m == 12 ? base::color_layer_spotlight: + m == 13 ? base::color_layer_spotlightblend: + m == 14 ? base::color_layer_overlay: + m == 15 ? base::color_layer_softlight: + m == 16 ? base::color_layer_hardlight: + m == 17 ? base::color_layer_pinlight: + m == 18 ? base::color_layer_hardmix: + m == 19 ? base::color_layer_difference: + m == 20 ? base::color_layer_exclusion: + m == 21 ? base::color_layer_hue: + m == 22 ? base::color_layer_saturation: + m == 23 ? base::color_layer_color: + m == 24 ? base::color_layer_brightness: + base::color_layer_blend; +} + +// 3dsmax Composite Map +export texture_return ad_3dsmax_composite +( + // layer 1 + uniform int blendMode1 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Blend Mode (unused)"), + anno::unused(), + anno::hidden() + ]], + texture_return map1 = texture_return() + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Map") + ]], + texture_return mask1 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Mask") + ]], + uniform float opacity1 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // layer2 + uniform int blendMode2 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Blend Mode") + ]], + texture_return map2 = texture_return() + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Map") + ]], + texture_return mask2 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Mask") + ]], + uniform float opacity2 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // layer3 + uniform int blendMode3 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Blend Mode") + ]], + texture_return map3 = texture_return() + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Map") + ]], + texture_return mask3 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Mask") + ]], + uniform float opacity3 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // Layer4 + uniform int blendMode4 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Blend Mode") + ]], + texture_return map4 = texture_return() + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Map") + ]], + texture_return mask4 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Mask") + ]], + uniform float opacity4 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Opacity"), + anno::hard_range(0.f, 100.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + opacity1 *= mask1.mono*0.01f; + texture_return t1 = opacity1 > 0.f ? + base::blend_color_layers + ( + layers: base::color_layer[] + ( + base::color_layer + ( + layer_color: map1.tint, + weight: opacity1, + mode: base::color_layer_blend + ) + ), + base: color(0.f) + ) + : texture_return(color(0.f), 0.f); + + opacity2 *= mask2.mono*0.01f; + texture_return t2 = opacity2 > 0.f ? + base::blend_color_layers + ( + layers: base::color_layer[] + ( + base::color_layer + ( + layer_color: map2.tint, + weight: blendMode2 == 3 ? -opacity2 : opacity2, + mode: ad_3dsmax_mapmode(blendMode2) + ) + ), + base: t1.tint + ) + : t1; + + opacity3 *= mask3.mono*0.01f; + texture_return t3 = opacity3 > 0.f ? + base::blend_color_layers + ( + layers: base::color_layer[] + ( + base::color_layer + ( + layer_color: map3.tint, + weight: blendMode3 == 3 ? -opacity3 : opacity3, + mode: ad_3dsmax_mapmode(blendMode3) + ) + ), + base: t2.tint + ) + : t2; + + opacity4 *= mask4.mono*0.01f; + texture_return t4 = opacity4 > 0.f ? + base::blend_color_layers + ( + layers: base::color_layer[] + ( + base::color_layer + ( + layer_color: map4.tint, + weight: blendMode4 == 3 ? -opacity4 : opacity4, + mode: ad_3dsmax_mapmode(blendMode4) + ) + ), + base: t3.tint + ): + t3; + + return t4; +} + +// 3dsmax Composite Map for Bump +export float3 ad_3dsmax_composite_bump +( + // Layer1 + uniform int blendMode1 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Blend Mode"), + anno::unused(), + anno::hidden() + ]], + float3 map1 = state::normal() + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Bump Map") + ]], + texture_return mask1 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Mask") + ]], + uniform float opacity1 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // Layer2 + uniform int blendMode2 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Blend Mode"), + anno::unused(), + anno::hidden() + ]], + float3 map2 = state::normal() + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Bump Map") + ]], + texture_return mask2 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Mask") + ]], + uniform float opacity2 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // Layer3 + uniform int blendMode3 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Blend Mode"), + anno::unused(), + anno::hidden() + ]], + float3 map3 = state::normal() + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Bump Map") + ]], + texture_return mask3 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Mask") + ]], + uniform float opacity3 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // Layer4 + uniform int blendMode4 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Blend Mode"), + anno::unused(), + anno::hidden() + ]], + float3 map4 = state::normal() + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Bump Map") + ]], + texture_return mask4 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Mask") + ]], + uniform float opacity4 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + uniform float factor = 1.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("Bump amount") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 n1 = opacity1 > 0.f ? + combine_normals(1.f - (opacity1/100.f*mask1.mono), state::normal(), opacity1/100.f*factor*mask1.mono, map1) + : state::normal(); + + float3 n2 = opacity2 > 0.f ? + combine_normals(1.f - (opacity2/100.f*mask2.mono), n1, opacity2/100.f*factor*mask2.mono, map2) + : n1; + + float3 n3 = opacity3 > 0.f ? + combine_normals(1.f - (opacity3/100.f*mask3.mono), n2, opacity3/100.f*factor*mask3.mono, map3) + : n2; + + float3 n4 = opacity4 > 0.f ? + combine_normals(1.f - (opacity4/100.f*mask4.mono), n3, opacity4/100.f*factor*mask4.mono, map4) + : n3; + + return n4; +} + +// 3dsmax Dent Map +export texture_return ad_3dsmax_dent +( + // Dent Params + color color1 = color(0.f) + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Color #1") + ]], + color color2 = color(1.f) + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Color #2") + ]], + uniform float size = 200.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Size") + ]], + uniform float strength = 20.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Strength") + ]], + uniform int iterations = 2 + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Iterations") + ]], + + // Coords + uniform float blur = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur"), + anno::unused() + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + // coordType: Object XYZ = 0, World XYZ = 1, Explicit Map Channel = 2, Vertex Color Channel = 3 + uniform int coordType = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("Source") + ]], + uniform int mapChannel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return base::perlin_noise_texture + ( + color1: color1, + color2: color2, + size: size / 30.0, // Experimental factor to improve the match + noise_levels: iterations, + absolute_noise: true, // Dent is absolute noise + noise_threshold_high: (strength != 0 ? 1/(strength) : 1), // Match seems rather close + apply_dent: true, + uvw: base::transform_coordinate + ( + transform: base::rotation_translation_scale + ( + scaling: tiling, + translation: offset, + rotation: float3(angle.x,angle.y,angle.z)/180.*math::PI + ), + coordinate: + ( + coordType == 0 ? // Object XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + ( + coordType == 1 ? // World XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_world): + ( + // coordType == 2 ? // Explicit Map Channel + // base::coordinate_source(texture_space: mapChannel-1): + base::coordinate_source(texture_space: mapChannel-1) // No support for Vertex Color Channel, fallback to UVs + ) + ) + ) + ) + ); +} + +// 3dsmax Dent Map for Bump +export float3 ad_3dsmax_dent_bump +( + // Dent Params + color color1 = color(0.f) + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Color #1") + ]], + color color2 = color(1.f) + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Color #2") + ]], + uniform float size = 200.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Size") + ]], + uniform float strength = 20.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Strength") + ]], + uniform int iterations = 2 + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Iterations") + ]], + + // Bump + uniform float factor = 1.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Bump amount") + ]], + + // Coords + uniform float blur = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur"), + anno::unused(), + anno::hidden() + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + // coordType: Object XYZ = 0, World XYZ = 1, Explicit Map Channel = 2, Vertex Color Channel = 3 + uniform int coordType = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("Source") + ]], + uniform int mapChannel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 perlin_normal = base::perlin_noise_bump_texture + ( + factor: factor * (strength / 100.f), // Experimental + size: size / 30.f, // Experimental factor to improve the match + noise_levels: iterations, + absolute_noise: true, // Dent is absolute noise + apply_dent: true, + uvw: base::transform_coordinate + ( + transform: base::rotation_translation_scale + ( + scaling: tiling, + translation: offset, + rotation: float3(angle.x,angle.y,angle.z)/180.f*math::PI + ), + coordinate: + ( + coordType == 0 ? // Object XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + ( + coordType == 1 ? // World XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_world): + ( + // coordType == 2 ? // Explicit Map Channel + // base::coordinate_source(texture_space: mapChannel-1): + base::coordinate_source(texture_space: mapChannel-1) // No support for Vertex Color Channel, fallback to UVs + ) + ) + ) + ) + ); + float f = math::average(color1 - color2) * factor; + return combine_normals( f, perlin_normal, 1.f - f, state::normal() ); +} + +// 3dsmax Gradient Ramp Map +export enum ad_3dsmax_gradient_interpolation +{ + custom = 0, + easy_in, + easy_in_out, + easy_out, + linear, + solid +}; + + +export texture_return ad_3dsmax_gradient_ramp +( + // Gradient Params + uniform float[] gradient_keys = float[](0.f, 50.f, 100.f) + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Keys") + ]], + uniform float3[] gradient_colors = float3[](float3(0.f, 0.f, 0.f), float3(0.5f, 0.5f, 0.5f), float3(1.f, 1.f, 1.f)) + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Colors") + ]], + uniform int gradient_type = 4 + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Type"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_gradient_interpolation gradient_interpolation = linear + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Interpolation") + ]], + + // Noise Params + uniform float amount = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Amount"), + anno::hard_range(0.f, 1.f) + ]], + // type: regular = 0, fractal = 1, turbulence = 2 + // 0- Regular (Generates plain noise. Basically the same as fractal noise with levels at 1.) + // 1- Fractal (Generates noise using a fractal algorithm. levels sets the number of iterations for the fractal noise.) + // 2- Turbulence (Generates fractal noise with an absolute value function applied to it to make fault lines.) + uniform int type = 0 + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Type") + ]], + uniform float size = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Size") + ]], + uniform float phase = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Phase") + ]], + uniform float levels = 4.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Levels") + ]], + uniform float threshold_low = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold Low") + ]], + uniform float threshold_high = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold High") + ]], + uniform float threshold_smooth = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold Smooth"), + anno::unused(), + anno::hidden() + ]], + + // Coords + uniform int map_channel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform bool u_tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool v_tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool u_mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool v_mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + uniform int UVW_Type = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW_Type"), + anno::unused(), + anno::hidden() + ]], + + // Output + uniform bool alpha_from_RGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB Intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump Amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output Amount"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Level"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + texture_return noise; + + if(amount > 0.f) + { + noise = base::perlin_noise_texture + ( + size: size/30.f, + noise_phase: phase, + noise_levels: (type == 0 ? 1 : int(levels)), // Levels only used for fractal and turbulence noise types + absolute_noise: type == 2, // If set to true, the appearance of the pattern will be more "billowing" and "turbulent" + noise_threshold_high: threshold_high, + noise_threshold_low: threshold_low, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: tiling, + rotation: angle/180.f*math::PI , + translation: offset, + u_mirror: u_mirror, + v_mirror: v_mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + } + + float3 position = state::texture_coordinate(0); + + float t = position.x + noise.mono*amount; + + t = t - int(t); + if( t < 0.f) + t += 1.f; + else if( t > 1.f) + t -= 1.f; + + t *= 100.f; + + int idx=0; + for(int i=0; i= t) + { + idx = i; + break; + } + } + + color c; + switch(gradient_interpolation) + { + case easy_in: + t = (t - gradient_keys[idx])/(gradient_keys[idx+1] - gradient_keys[idx]); + c = color(math::lerp( gradient_colors[idx], gradient_colors[idx+1], t*t)); + break; + case easy_in_out: + t = (t - gradient_keys[idx])/(gradient_keys[idx+1] - gradient_keys[idx]); + c = color(math::lerp( gradient_colors[idx], gradient_colors[idx+1], t*t*(3.f - 2.f*t))); + break; + case easy_out: + t = (t - gradient_keys[idx])/(gradient_keys[idx+1] - gradient_keys[idx]); + c = color(math::lerp( gradient_colors[idx], gradient_colors[idx+1], math::sqrt(t))); + break; + default: + case linear: + t = (t - gradient_keys[idx])/(gradient_keys[idx+1] - gradient_keys[idx]); + c = color(math::lerp( gradient_colors[idx], gradient_colors[idx+1], t)); + break; + case solid: + c = color(gradient_colors[idx]); + break; + } + + return texture_return(c, math::average(c)); +} + +// 3dsmax Gradient Ramp Map for Bump +export float3 ad_3dsmax_gradient_ramp_bump +( + // Gradient Params + uniform float[] gradient_keys = float[](0.f, 50.f, 100.f) + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Keys"), + anno::unused(), + anno::hidden() + + ]], + uniform float3[] gradient_colors = float3[](float3(0.f, 0.f, 0.f), float3(0.5f, 0.5f, 0.5f), float3(1.f, 1.f, 1.f)) + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Colors"), + anno::unused(), + anno::hidden() + ]], + uniform int gradient_type = 5 + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Type"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_gradient_interpolation gradient_interpolation = linear + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Interpolation"), + anno::unused(), + anno::hidden() + ]], + + // Noise Params + uniform float amount = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Amount"), + anno::hard_range(0.f, 1.f) + ]], + // type: regular = 0, fractal = 1, turbulence = 2 + // 0- Regular (Generates plain noise. Basically the same as fractal noise with levels at 1.) + // 1- Fractal (Generates noise using a fractal algorithm. levels sets the number of iterations for the fractal noise.) + // 2- Turbulence (Generates fractal noise with an absolute value function applied to it to make fault lines.) + uniform int type = 0 + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Type") + ]], + uniform float size = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Size") + ]], + uniform float phase = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Phase") + ]], + uniform float levels = 4.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Levels") + ]], + uniform float threshold_low = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold Low") + ]], + uniform float threshold_high = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold High") + ]], + uniform float threshold_smooth = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold Smooth"), + anno::unused(), + anno::hidden() + ]], + + // Bump + uniform float factor = 1.f + [[ + anno::in_group("Bump Parameters"), + anno::display_name("Bump factor") + ]], + + // Coords + uniform int map_channel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform bool u_tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool v_tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool u_mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool v_mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + uniform int UVW_Type = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW_Type"), + anno::unused(), + anno::hidden() + ]], + + // Output + uniform bool alpha_from_RGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB Intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump Amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output Amount"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Level"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 perlin_normal = base::perlin_noise_bump_texture + ( + factor: factor, + size: size/30.f, + noise_phase: phase, + noise_levels: (type == 0 ? 1 : int(levels)), // Levels only used for fractal and turbulence noise types + absolute_noise: type == 2, // If set to true, the appearance of the pattern will be more "billowing" and "turbulent" + noise_threshold_high: threshold_high, + noise_threshold_low: threshold_low, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: tiling, + rotation: angle/180.f*math::PI , + translation: offset, + u_mirror: u_mirror, + v_mirror: v_mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + // return combine_normals( factor, perlin_normal, 1.f-factor, state::normal() ); + + return math::normalize(math::lerp(state::normal(), perlin_normal, factor*amount)); + +} + + +// 3dsmax Falloff Map Type +export enum ad_3dsmax_falloff_Type +[[ + anno::hidden() +]] +{ + Towards_Away, + Perpendicular_Parallel, + Fresnel, + Shadow_Light, + Distance_Blend +}; + +// 3dsmax Falloff Map directions +export enum ad_3dsmax_falloff_direction +[[ + anno::hidden() +]] +{ + View, + Camera_X, + Camera_Y, + Object, + Local_X, + Local_Y, + Local_Z, + World_X, + World_Y, + World_Z +}; + +// 3dsmax Falloff Map +export texture_return ad_3dsmax_falloff +( + texture_return color1 = texture_return() + [[ + anno::in_group("Falloff"), + anno::display_name("Color #1") + ]], + texture_return color2 = texture_return() + [[ + anno::in_group("Falloff"), + anno::display_name("Color #1"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_falloff_Type falloff_type = Perpendicular_Parallel + [[ + anno::in_group("Falloff"), + anno::display_name("Falloff type"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_falloff_direction falloff_direction = View + [[ + anno::in_group("Falloff"), + anno::display_name("Falloff direction"), + anno::unused(), + anno::hidden() + ]], + float4x4 node = float4x4() + [[ + anno::in_group("Falloff"), + anno::display_name("Node"), + anno::unused(), + anno::hidden() + ]], + uniform float nearDistance = 0.f + [[ + anno::in_group("Falloff"), + anno::display_name("Near distance"), + anno::unused(), + anno::hidden() + ]], + uniform float farDistance = 1000000.f + [[ + anno::in_group("Falloff"), + anno::display_name("Far distance"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return color1; +} + +// 3dsmax Mix Map +export texture_return ad_3dsmax_mix +( + texture_return color1 = texture_return() + [[ + anno::in_group("Mix parameters"), + anno::display_name("Color #1") + ]], + texture_return color2 = texture_return() + [[ + anno::in_group("Mix parameters"), + anno::display_name("Color #2") + ]], + float mixAmount = 0.f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Mix amount"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool useCurve = false + [[ + anno::in_group("Mix parameters"), + anno::display_name("Use curve") + ]], + uniform float lower = 0.3f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Lower"), + anno::hard_range(0.f, 1.f) + ]], + uniform float upper = .7f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Upper"), + anno::hard_range(0.f, 1.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float t = useCurve ? math::smoothstep(lower, upper, mixAmount) : math::smoothstep(0.0, 1.0, mixAmount); + + return texture_return( + math::lerp(color1.tint,color2.tint, t), + math::lerp(color1.mono,color2.mono, t)); +} + +// 3dsmax Mix Map for Bump +export float3 ad_3dsmax_mix_bump +( + float3 color1 = state::normal() + [[ + anno::in_group("Mix parameters"), + anno::display_name("Bump Map #1") + ]], + float3 color2 = state::normal() + [[ + anno::in_group("Mix parameters"), + anno::display_name("Bump Map #2") + ]], + float mixAmount = 0.f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Mix amount"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool useCurve = false + [[ + anno::in_group("Mix parameters"), + anno::display_name("Use Curve") + ]], + uniform float lower = 0.3f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Lower"), + anno::hard_range(0.f, 1.f) + ]], + uniform float upper = .7f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Upper"), + anno::hard_range(0.f, 1.f) + ]], + + // Bump + uniform float bump_amount = 1.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Bump amount") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float t = useCurve ? math::smoothstep(lower, upper, mixAmount) : math::smoothstep(0.0, 1.0, mixAmount); + float3 mix_normal = math::normalize(math::lerp(color1, color2, t)); + + return math::normalize(math::lerp(state::normal(), mix_normal, bump_amount)); +} + +// 3dsmax Noise Map +export texture_return ad_3dsmax_noise +( + // Noise Params + color color1 = color(0.f) + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Color #1") + ]], + color color2 = color(1.f) + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Color #2") + ]], + uniform float size = 25.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Size") + ]], + uniform float phase = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Phase") + ]], + uniform float levels = 3.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Levels") + ]], + uniform float thresholdLow = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Threshold Low") + ]], + uniform float thresholdHigh = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Threshold High") + ]], + // type: regular = 0, fractal = 1, turbulence = 2 + // 0- Regular (Generates plain noise. Basically the same as fractal noise with levels at 1.) + // 1- Fractal (Generates noise using a fractal algorithm. levels sets the number of iterations for the fractal noise.) + // 2- Turbulence (Generates fractal noise with an absolute value function applied to it to make fault lines.) + uniform int type = 1 + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Type") + ]], + + // Coords + uniform float blur = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur"), + anno::unused(), + anno::hidden() + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + // coordType: Object XYZ = 0, World XYZ = 1, Explicit Map Channel = 2, Vertex Color Channel = 3 + uniform int coordType = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("Source") + ]], + uniform int mapChannel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]], + + // Output + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB Intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump Amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output Amount"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Level"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return base::perlin_noise_texture + ( + color1: color1, + color2: color2, + size: size/30.f, + noise_phase: phase, + noise_levels: (type == 0 ? 1 : int(levels)), // Levels only used for fractal and turbulence noise types + absolute_noise: type == 2, // If set to true, the appearance of the pattern will be more "billowing" and "turbulent" + noise_threshold_high: thresholdHigh, + noise_threshold_low: thresholdLow, + uvw: base::transform_coordinate + ( + transform: base::rotation_translation_scale + ( + scaling: tiling, + translation: offset, + rotation: float3(angle.x,angle.y,angle.z)/180.*math::PI + ), + coordinate: + ( + coordType == 0 ? // Object XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + ( + coordType == 1 ? // World XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_world): + ( + // coordType == 2 ? // Explicit Map Channel + // base::coordinate_source(texture_space: mapChannel-1): + base::coordinate_source(texture_space: mapChannel-1) // No support for Vertex Color Channel, fallback to UVs + ) + ) + ) + ) + ); +} + +// 3dsmax Noise Map for Bump +export float3 ad_3dsmax_noise_bump +( + // Noise Params + color color1 = color(0.f) + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Color #1") + ]], + color color2 = color(1.f) + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Color #2") + ]], + uniform float size = 25.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Size") + ]], + uniform float phase = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Phase") + ]], + uniform float levels = 3.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Levels") + ]], + uniform float thresholdLow = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Threshold Low") + ]], + uniform float thresholdHigh = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Threshold High") + ]], + // type: regular = 0, fractal = 1, turbulence = 2 + // 0- Regular (Generates plain noise. Basically the same as fractal noise with levels at 1.) + // 1- Fractal (Generates noise using a fractal algorithm. levels sets the number of iterations for the fractal noise.) + // 2- Turbulence (Generates fractal noise with an absolute value function applied to it to make fault lines.) + uniform int type = 1 + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Type") + ]], + + // Bump + uniform float factor = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Bump amount") + ]], + + // Coords + uniform float blur = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur"), + anno::unused(), + anno::hidden() + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + // coordType: Object XYZ = 0, World XYZ = 1, Explicit Map Channel = 2, Vertex Color Channel = 3 + uniform int coordType = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("Source") + ]], + uniform int mapChannel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]], + + // Output + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB Intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.0 + [[ + anno::in_group("Output"), + anno::display_name("Bump Amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.0 + [[ + anno::in_group("Output"), + anno::display_name("Output Amount"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_level = 1.0 + [[ + anno::in_group("Output"), + anno::display_name("RGB Level"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_offset = 0.0 + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 perlin_normal = base::perlin_noise_bump_texture + ( + factor: factor, + size: size/30.f, + noise_phase: phase, + noise_levels: (type == 0 ? 1 : int(levels)), // Levels only used for fractal and turbulence noise types + absolute_noise: type == 2, // If set to true, the appearance of the pattern will be more "billowing" and "turbulent" + noise_threshold_high: thresholdHigh, + noise_threshold_low: thresholdLow, + uvw: base::transform_coordinate + ( + transform: base::rotation_translation_scale + ( + scaling: tiling, + translation: offset, + rotation: float3(angle.x,angle.y,angle.z)/180.*math::PI + ), + coordinate: + ( + coordType == 0 ? // Object XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + ( + coordType == 1 ? // World XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_world): + ( + // coordType == 2 ? // Explicit Map Channel + // base::coordinate_source(texture_space: mapChannel-1): + base::coordinate_source(texture_space: mapChannel-1) // No support for Vertex Color Channel, fallback to UVs + ) + ) + ) + ) + ); + float f = math::average(color1 - color2) * factor; + return combine_normals( f, perlin_normal, 1-f, state::normal() ); +} + +// 3dsmax Output Map +export texture_return ad_3dsmax_output +( + texture_return MAP1 = texture_return() + [[ + anno::in_group("Output Parameters"), + anno::display_name("Map") + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("Bump amount"), + anno::unused() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Clamp") + ]], + uniform bool invert = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Alpha from RGB intensity") + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("Output amount"), + anno::unused() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("RGB level") + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("RGB offset") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + color rgb(MAP1.tint*rgb_level + rgb_offset); + + if(clamp || invert) + rgb = math::clamp(rgb, 0.f, 1.f); + + if(invert) + rgb = color(1.f) - rgb; + + return texture_return(rgb, alphaFromRGB ? math::luminance(rgb) : MAP1.mono); + +} + +// 3dsmax Output Map for Bump +export float3 ad_3dsmax_output_bump +( + float3 MAP1 = state::normal() + [[ + anno::in_group("Output Parameters"), + anno::display_name("Map") + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("Bump amount") + ]], + uniform bool clamp = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Clamp"), + anno::unused() + ]], + uniform bool invert = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Alpha from RGB intensity"), + anno::unused() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("Output amount"), + anno::unused() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("RGB level"), + anno::unused() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("RGB offset"), + anno::unused() + ]], + uniform float base_bump_amount = 1.f + [[ + anno::in_group("Bump"), + anno::display_name("Base bump amount"), + anno::hard_range(0.f, 1.f) + ]] + +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 normal = MAP1; + if(invert) + { + normal = transform_internal_to_tangent(normal); + normal = float3(-normal.x, -normal.y, normal.z); + normal = transform_tangent_to_internal(normal); + } + + return math::normalize(math::lerp(state::normal(), normal, bump_amount*base_bump_amount)); +} + +int rnd_next(int seed) { + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + return math::abs(float(seed) * 4.6566e-10f); +} + +// Convert from the HSV color model to the RGB color model +float3 hsv_to_rgb(float3 hsv) +{ + // grayscale? + if(hsv.y < limits::FLOAT_MIN) + return float3(hsv.z); + + float h_prime = (hsv.x < 1.0f) ? hsv.x * 6.0f : 0.0f; // H * 360.0/60.0 + float h_floor = math::floor(h_prime); + float f = h_prime - h_floor; + float zy = hsv.z*hsv.y; + float a = hsv.z - zy; + float b = hsv.z - zy*f; + float c = a + zy*f; + + switch(int(h_floor)) + { + default: + // hue out of [0,1] range... + // fall through... + case 0: + return float3(hsv.z, c, a); + case 1: + return float3(b, hsv.z, a); + case 2: + return float3(a, hsv.z, c); + case 3: + return float3(a, b, hsv.z); + case 4: + return float3(c, a, hsv.z); + case 5: + return float3(hsv.z, a, b); + } +} + +// Convert from the RGB color model to the HSV color model +export float3 rgb_to_hsv(float3 rgb) +{ + float max = math::max(rgb.x, math::max(rgb.y, rgb.z)); + float min = math::min(rgb.x, math::min(rgb.y, rgb.z)); + float range = max - min; + + if(range > limits::FLOAT_MIN) + { + float inv_range = (1.0f/6.0f)/range; + + float saturation = (max > limits::FLOAT_MIN) ? (range / max) : 0.0f; + float hue = (saturation != 0.0f) ? + ((max == rgb.x) ? ((rgb.y-rgb.z)*inv_range) // R is max + : (max == rgb.y) ? ((2.0f/6.0f) + (rgb.z-rgb.x)*inv_range) // G is max + : ((4.0f/6.0f) + (rgb.x-rgb.y)*inv_range)) // B is max + : 0.0f; // hue is undefined (assume 0) + + return float3((hue >= 0.0f) ? hue : (hue + 1.0f), saturation, max); + + } + else // grayscale + { + return float3(0.f, 0.f, max); + } +} + +// 3dsmax Tiles map +export texture_return ad_3dsmax_tiles +( + // Coordinates + uniform int map_channel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform bool U_Tile = true //it is actually an error if both mirror and tile are true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool U_Mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool V_Mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle"), + anno::unused(), + anno::hidden() + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused(), + anno::hidden() + ]], + + // Noise + uniform bool use_noise = false + [[ + anno::in_group("Noise"), + anno::display_name("Use Noise") + ]], + uniform float noise_amount = 1.f + [[ + anno::in_group("Noise"), + anno::display_name("Amount"), + anno::hard_range(0.f, 100.f), + anno::enable_if("use_noise") + ]], + uniform int noise_levels = 1 + [[ + anno::in_group("Noise"), + anno::display_name("Levels"), + anno::hard_range(1, 10), + anno::enable_if("use_noise") + ]], + uniform float noise_size = 1.f + [[ + anno::in_group("Noise"), + anno::display_name("Size"), + anno::hard_range(0.001f, 100.f), + anno::enable_if("use_noise") + ]], + uniform float noise_phase = 0.f + [[ + anno::in_group("Noise"), + anno::display_name("Phase"), + anno::hard_range(0.f, 100.f), + anno::enable_if("use_noise") + ]], + +// Standard Controls + uniform int preset_type = 5 + [[ + anno::in_group("Standard Controls"), + anno::display_name("Preset type"), + anno::hard_range(0, 7) + ]], + +// Advanced Controls + color tiles_color = color(0.6f) + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Tiles texture") + ]], + uniform float tiles_horizontal_count = 4.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Horizontal count"), + anno::hard_range(0.f, 100.f) + ]], + uniform float tiles_vertical_count = 4.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Vertical count"), + anno::hard_range(0.f, 100.f) + ]], + uniform float tiles_color_variance = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Color variance"), + anno::hard_range(0.f, 100.f) + ]], + uniform float tiles_fade_variance = 0.05f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Fade variance"), + anno::hard_range(0.f, 100.f) + ]], + color grout_color = color(0.2f) + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Grout texture") + ]], + uniform bool grout_lock_gap_simetry = true + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Gap simetry") + ]], + uniform float grout_horizontal_gap = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Horizontal gap"), + anno::hard_range(0.f, 100.f) + ]], + uniform float grout_vertical_gap = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Vertical gap"), + anno::hard_range(0.f, 100.f), + anno::enable_if("!grout_lock_gap_simetry") + ]], + uniform float grout_percent_holes = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Percent holes"), + anno::hard_range(0.f, 100.f) + ]], + uniform float grout_rought = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Rough"), + anno::hard_range(0.f, 200.f) + ]], + uniform int random_seed = 1444 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Random seed"), + anno::hard_range(0, 65535) + ]], + uniform float line_shift = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Line shift"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform float random_shift = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Random shift"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform bool row_modify = false + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Row modify"), + anno::unused(), + anno::hidden() + ]], + uniform int per_row = 2 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Per row"), + anno::hard_range(0, 50), + anno::unused(), + anno::hidden() + ]], + uniform float per_row_change = 1.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Change"), + anno::hard_range(0.f, 5.f), + anno::unused(), + anno::hidden() + ]], + uniform bool column_modify = false + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Column modify"), + anno::unused(), + anno::hidden() + ]], + uniform int per_column = 2 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Per column"), + anno::hard_range(0, 50), + anno::unused(), + anno::hidden() + ]], + uniform float per_column_change = 1.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Change"), + anno::hard_range(0.f, 5.f), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 uvw = state::texture_coordinate(0); + float2 uv(0.f, 0.f); + + // use noise? + if(use_noise && noise_amount > 0.f) + { + texture_return nx = base::perlin_noise_texture + ( + size: noise_size/30.f, + noise_phase: noise_phase*0.01f, + noise_levels: noise_levels, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: float3(U_Tiling), + rotation: float3(U_angle/180.f*math::PI), + translation: float3(U_Offset), + u_mirror: U_Mirror, + v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + + texture_return ny = base::perlin_noise_texture + ( + size: noise_size/30.f, + noise_phase: noise_phase*0.01f + 0.5f, + noise_levels: noise_levels, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: float3(V_Tiling), + rotation: float3(V_angle/180.f*math::PI), + translation: float3(V_Offset), + u_mirror: U_Mirror, + v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + + uv.x += nx.mono*noise_amount*0.01f; + uv.y += ny.mono*noise_amount*0.01f; + } + + if(grout_rought > 0.f) + { + base::texture_coordinate_info tci; + + tci.position *= 30.f; + tci.position.z = 1.f; + texture_return nx = base::perlin_noise_texture + ( + uvw: tci, + noise_levels: 1, + absolute_noise: true + ); + + tci.position.z = 2.f; + texture_return ny = base::perlin_noise_texture + ( + uvw: tci, + noise_levels: 1, + absolute_noise: true + ); + + uv.x += nx.mono*grout_rought*0.001f; + uv.y += ny.mono*grout_rought*0.001f; + } + + uv += float2((uvw.x - U_Offset)*U_Tiling, (uvw.y - V_Offset)*V_Tiling); + uv = float2(uv.x*tiles_horizontal_count, uv.y*tiles_vertical_count); + + bool is_grout; + + float gap_u = grout_horizontal_gap*0.01f; + float gap_v = grout_lock_gap_simetry ? gap_u : grout_vertical_gap*0.01f; + + gap_u *= tiles_horizontal_count; + gap_v *= tiles_vertical_count; + + int tile_idx = random_seed; + + switch(preset_type) + { + case 1: // running bond + { + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 2: // common flemish bond + { + bool odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + if(odd_row) + { + uv.x = (uv.x + 0.25f)*0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + gap_u *= 0.5f; + + if(math::abs(uv.x) > 0.375f) + tile_idx *= 13; + else if(math::abs(uv.x) > 0.75f) + tile_idx *= 17; + + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + ((uv.x - 0.375f) > -gap_u) && ((uv.x - 0.375f) <= gap_u) || + ((uv.x - 0.75f) > -gap_u) && ((uv.x - 0.75f) <= gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + else + { + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + } + break; + + case 3: // english bond + { + bool odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + uv.x = uv.x*2.f - 0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + gap_u *= 2.f; + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 4: // 1/2 running bond + { + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.25f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 5: // stack bond + { + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 6: // fine running bond + { + bool odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + { + uv *= 2.f; + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.5f; + } + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + { + gap_u *= 2.f; + gap_v *= 2.f; + } + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 7: // fine stack bond + { + bool odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + uv *= 2.f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + { + gap_u *= 2.f; + gap_v *= 2.f; + } + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + default: // checker + is_grout = (math::frac(uv.x) < 0.5f) == (math::frac(uv.y) < 0.5f); + break; + } + + int tile_idx_seed = rnd_next(tile_idx); + float rnd = (rnd_value(tile_idx_seed) - 0.5f); + + // % holes + if(!is_grout) + is_grout = rnd_value(rnd_next(tile_idx_seed)) < grout_percent_holes*0.01f; + + // color variance, fade variance + color tc = tiles_color; + + if(!is_grout && (tiles_color_variance > 0.f || tiles_fade_variance > 0.f)) + { + float3 hsv = rgb_to_hsv(float3(tc)); + + // color variance + if(tiles_color_variance > 0.f) + { + float t = rnd*tiles_color_variance*0.25f; + + if(t < 0.f) + { + hsv.y = math::clamp(hsv.y + t, 0.f, 1.f); + } + else + { + t = math::clamp(t, 0.f, 1.f); + + hsv.y += (0.f - hsv.y)*t; + hsv.z += (0.5f - hsv.z)*t; + } + } + + // fade variance + if(tiles_fade_variance > 0.f) + { + hsv.z += rnd*tiles_fade_variance*0.5f; + if(hsv.z < 0.f) + { + hsv.z = 0.f; + } + else if(hsv.z > 1.f) + { + hsv.y -= (hsv.z -1.f); + if(hsv.y < 0.f) + hsv.y = 0.f; + hsv.z = 1.f; + } + } + + tc = color(hsv_to_rgb(hsv)); + } + + texture_return result; + result.tint = is_grout ? grout_color : tc; + result.mono = math::average(result.tint); + + return result; +} + + +// 3dsmax Tiles map for bump +export float3 ad_3dsmax_tiles_bump +( + // Coordinates + uniform int map_channel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform bool U_Tile = true //it is actually an error if both mirror and tile are true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool U_Mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool V_Mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle"), + anno::unused(), + anno::hidden() + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused(), + anno::hidden() + ]], + + // Noise + uniform bool use_noise = false + [[ + anno::in_group("Noise"), + anno::display_name("Use Noise") + ]], + uniform float noise_amount = 1.f + [[ + anno::in_group("Noise"), + anno::display_name("Amount"), + anno::hard_range(0.f, 100.f), + anno::enable_if("use_noise") + ]], + uniform int noise_levels = 1 + [[ + anno::in_group("Noise"), + anno::display_name("Levels"), + anno::hard_range(1, 10), + anno::enable_if("use_noise") + ]], + uniform float noise_size = 1.f + [[ + anno::in_group("Noise"), + anno::display_name("Size"), + anno::hard_range(0.001f, 100.f), + anno::enable_if("use_noise") + ]], + uniform float noise_phase = 0.f + [[ + anno::in_group("Noise"), + anno::display_name("Phase"), + anno::hard_range(0.f, 100.f), + anno::enable_if("use_noise") + ]], + +// Standard Controls + uniform int preset_type = 5 + [[ + anno::in_group("Standard Controls"), + anno::display_name("Preset type"), + anno::hard_range(0, 7) + ]], + +// Advanced Controls + float3 tiles_color = state::normal() + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Tiles texture") + ]], + uniform float tiles_horizontal_count = 4.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Horizontal count"), + anno::hard_range(0.f, 100.f) + ]], + uniform float tiles_vertical_count = 4.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Vertical count"), + anno::hard_range(0.f, 100.f) + ]], + uniform float tiles_color_variance = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Color variance"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform float tiles_fade_variance = 0.05f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Fade variance"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + float3 grout_color = state::normal() + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Grout texture") + ]], + uniform bool grout_lock_gap_simetry = true + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Gap simetry") + ]], + uniform float grout_horizontal_gap = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Horizontal gap"), + anno::hard_range(0.f, 100.f) + ]], + uniform float grout_vertical_gap = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Vertical gap"), + anno::hard_range(0.f, 100.f), + anno::enable_if("!grout_lock_gap_simetry") + ]], + uniform float grout_percent_holes = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Percent holes"), + anno::hard_range(0.f, 100.f) + ]], + uniform float grout_rought = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Rough"), + anno::hard_range(0.f, 200.f) + ]], + uniform int random_seed = 1444 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Random seed"), + anno::hard_range(0, 65535) + ]], + uniform float line_shift = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Line shift"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform float random_shift = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Random shift"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform bool row_modify = false + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Row modify"), + anno::unused(), + anno::hidden() + ]], + uniform int per_row = 2 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Per row"), + anno::hard_range(0, 50), + anno::unused(), + anno::hidden() + ]], + uniform float per_row_change = 1.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Change"), + anno::hard_range(0.f, 5.f), + anno::unused(), + anno::hidden() + ]], + uniform bool column_modify = false + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Column modify"), + anno::unused(), + anno::hidden() + ]], + uniform int per_column = 2 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Per column"), + anno::hard_range(0, 50), + anno::unused(), + anno::hidden() + ]], + uniform float per_column_change = 1.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Change"), + anno::hard_range(0.f, 5.f), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Bump"), + anno::display_name("Bump amount"), + anno::hard_range(0.f, 1.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 uvw = state::texture_coordinate(0); + float2 uv(0.f, 0.f); + + // use noise? + if(use_noise && noise_amount > 0.f) + { + texture_return nx = base::perlin_noise_texture + ( + size: noise_size/30.f, + noise_phase: noise_phase*0.01f, + noise_levels: noise_levels, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: float3(U_Tiling), + rotation: float3(U_angle/180.f*math::PI), + translation: float3(U_Offset), + u_mirror: U_Mirror, + v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + + texture_return ny = base::perlin_noise_texture + ( + size: noise_size/30.f, + noise_phase: noise_phase*0.01f + 0.5f, + noise_levels: noise_levels, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: float3(V_Tiling), + rotation: float3(V_angle/180.f*math::PI), + translation: float3(V_Offset), + u_mirror: U_Mirror, + v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + + uv.x += nx.mono*noise_amount*0.01f; + uv.y += ny.mono*noise_amount*0.01f; + } + + if(grout_rought > 0.f) + { + base::texture_coordinate_info tci; + + tci.position *= 30.f; + tci.position.z = 1.f; + texture_return nx = base::perlin_noise_texture + ( + uvw: tci, + noise_levels: 1, + absolute_noise: true + ); + + tci.position.z = 2.f; + texture_return ny = base::perlin_noise_texture + ( + uvw: tci, + noise_levels: 1, + absolute_noise: true + ); + + uv.x += nx.mono*grout_rought*0.001f; + uv.y += ny.mono*grout_rought*0.001f; + } + + uv += float2((uvw.x - U_Offset)*U_Tiling, (uvw.y - V_Offset)*V_Tiling); + uv = float2(uv.x*tiles_horizontal_count, uv.y*tiles_vertical_count); + + bool is_grout = false; + bool odd_row; + + float du = 0.f, dv = 0.f; + + float gap_u = grout_horizontal_gap*0.01f; + float gap_v = grout_lock_gap_simetry ? gap_u : grout_vertical_gap*0.01f; + + gap_u *= tiles_horizontal_count; + gap_v *= tiles_vertical_count; + + float tile_edge_u = 0.5f*0.01f; + float tile_edge_v = 0.5f*0.01f; + + int tile_idx = random_seed; + + switch(preset_type) + { + case 1: // running bond + { + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + break; + + case 2: // common flemish bond + { + odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + if(odd_row) + { + uv.x = (uv.x + 0.25f)*0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + gap_u *= 0.5f; + tile_edge_u *= 0.5f; + + if(uv.x > 0.375f) + tile_idx *= 13; + else if(uv.x > 0.75f) + tile_idx *= 17; + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + ((uv.x - 0.375f) > -gap_u) && ((uv.x - 0.375f) <= gap_u) || + ((uv.x - 0.75f) > -gap_u) && ((uv.x - 0.75f) <= gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + else + { + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + } + break; + + case 3: // english bond + { + odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + uv.x = uv.x*2.f - 0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + { + gap_u *= 2.f; + tile_edge_u *= 2.f; + } + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + break; + + case 4: // 1/2 running bond + { + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.25f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 5: // stack bond + { + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 6: // fine running bond + { + odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + { + uv *= 2.f; + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.5f; + } + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + { + gap_u *= 2.f; + gap_v *= 2.f; + tile_edge_u *= 2.f; + tile_edge_v *= 2.f; + } + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 7: // fine stack bond + { + odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + uv *= 2.f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + { + gap_u *= 2.f; + gap_v *= 2.f; + tile_edge_u *= 2.f; + tile_edge_v *= 2.f; + } + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + default: // checker + is_grout = (math::frac(uv.x) < 0.5f) == (math::frac(uv.y) < 0.5f); + break; + } + + // calculate tangential vectors for tile edges. + if(!is_grout) + { + if(preset_type == 2 && odd_row) // common flemish bond + { + if(uv.x < 0.375f) + { + if(uv.x < gap_u + tile_edge_u) + du = -(uv.x - gap_u)/tile_edge_u; + else if((0.375f - uv.x) < gap_u + tile_edge_u) + du = (0.375f - uv.x + gap_u)/tile_edge_u; + } + else if (uv.x < 0.75f) + { + if((uv.x - 0.375f) < gap_u + tile_edge_u) + du = -((uv.x - 0.375f) - gap_u)/tile_edge_u; + else if((0.75f - uv.x) < gap_u + tile_edge_u) + du = (0.75f - uv.x + gap_u)/tile_edge_u; + } + else + { + if((uv.x - 0.75f) < gap_u + tile_edge_u) + du = -((uv.x - 0.75f) - gap_u)/tile_edge_u; + else if((1.f - uv.x) < gap_u + tile_edge_u) + du = (1.f - uv.x + gap_u)/tile_edge_u; + } + } + else // everything else + { + if(uv.x < gap_u + tile_edge_u) + du = -(uv.x - gap_u)/tile_edge_u; + else if((1.f - uv.x) < gap_u + tile_edge_u) + du = (1.f - uv.x + gap_u)/tile_edge_u; + } + + if(uv.y < gap_v + tile_edge_v) + dv = -(uv.y - gap_v)/tile_edge_v; + else if((1.f - uv.y) < gap_v + tile_edge_v) + dv = (1.f - uv.y + gap_v)/tile_edge_v; + } + + int tile_idx_seed = rnd_next(tile_idx); + // float rnd = (rnd_value(tile_idx_seed) - 0.5f); + + // % holes + if(!is_grout) + is_grout = rnd_value(rnd_next(tile_idx_seed)) < grout_percent_holes*0.01f; + + if(is_grout) + { + return grout_color; + } + else + { + float3 tiles_normal = + state::texture_tangent_u(0) * du + + state::texture_tangent_v(0) * dv + + tiles_color * 1.f; + + return math::normalize(math::normalize(math::lerp(state::normal(), tiles_normal, bump_amount))); + } + +} \ No newline at end of file diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/ad_3dsmax_materials.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/ad_3dsmax_materials.mdl new file mode 100644 index 0000000000000000000000000000000000000000..aaac9d18ad3be8b6d242c3ebdc7945d1690895a5 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/ad_3dsmax_materials.mdl @@ -0,0 +1,740 @@ +// Copyright 2023 NVIDIA Corporation. All rights reserved. +// +// NVIDIA CORPORATION and its licensors retain all intellectual property +// and proprietary rights in and to this software, related documentation +// and any modifications thereto. Any use, reproduction, disclosure or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA CORPORATION is strictly prohibited. + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; + +// 3dsmax Architectutal Material +export material ad_3dsmax_architectural( + float3 bumpMap = state::normal(), + float cutoutMap = 1., + color Diffuse = color(.5), + float displacementMap = 0., + uniform float ior = 1.5, + float luminance = 0., + float shininess = 1., // In the range [0..100], inverse of the roughness + float translucency = 0., + float transparency = 0. +) + = let +{ + bsdf diffuseLayer = df::diffuse_reflection_bsdf + ( + tint: Diffuse + ); + + bsdf reflectionLayer = df::simple_glossy_bsdf + ( + tint: color(1), + roughness_u: 1 - (shininess/100), + mode: df::scatter_reflect + ); + + bsdf translucentLayer = df::diffuse_transmission_bsdf + ( + tint: Diffuse + ); + + bsdf transparentLayer = df::simple_glossy_bsdf + ( + tint: color(1), + roughness_u: 0, + mode: df::scatter_transmit + ); + + bsdf transparentTranslucentMixer = df::weighted_layer + ( + weight: (translucency/100), + layer: translucentLayer, + base: transparentLayer + ); + + bsdf transparentDiffuseMixer = df::weighted_layer + ( + weight: (transparency/100), + layer: transparentTranslucentMixer, + base: diffuseLayer + ); + + bsdf glossyMixer = df::fresnel_layer + ( + ior: ior, + layer: reflectionLayer, + base: transparentDiffuseMixer + ); + + bsdf surface_bsdf = glossyMixer; +} +in material +( + ior: color(ior), + surface: material_surface + ( + scattering: surface_bsdf, + emission: material_emission + ( + emission: df::diffuse_edf(), + intensity: color(luminance), + mode: intensity_power + ) + ), + geometry: material_geometry + ( + cutout_opacity: cutoutMap, + normal: bumpMap, + displacement: displacementMap * state::normal() * state::scene_units_per_meter() + ) +); + +// 3dsmax Blend Material +export material ad_3dsmax_blend +( + material material1 = material() + [[ + anno::in_group("Blend parameters"), + anno::display_name("Material 1") + ]], + material material2 = material() + [[ + anno::in_group("Blend parameters"), + anno::display_name("Material 2") + ]], + float mixAmount = 0.f + [[ + anno::in_group("Blend parameters"), + anno::display_name("Mix amount"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool useCurve = false + [[ + anno::in_group("Blend parameters"), + anno::display_name("Use curve") + ]], + uniform float lower = 0.3f + [[ + anno::in_group("Blend parameters"), + anno::display_name("Lower"), + anno::hard_range(0.f, 1.f) + ]], + uniform float upper = .7f + [[ + anno::in_group("Blend parameters"), + anno::display_name("Upper"), + anno::hard_range(0.f, 1.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + float t = useCurve ? math::smoothstep(lower, upper, mixAmount) : math::smoothstep(0.f, 1.f, mixAmount); + float3 normal_mix = math::normalize(material1.geometry.normal*t + material2.geometry.normal*(1.f - t)); + + bsdf bsdf_mix = + df::normalized_mix + ( + components: df::bsdf_component[] + ( + df::bsdf_component + ( + weight: 1.f - t, + component: material1.surface.scattering + ), + df::bsdf_component + ( + weight: t, + component: material2.surface.scattering + ) + ) + ); +} +in material +( + ior : material1.ior, + surface : material_surface(scattering: bsdf_mix), + geometry : material_geometry + ( + normal : normal_mix + ) +); + + +// 3dsmax Double Sided Material +export material ad_3dsmax_double_sided( + material material1 = material(), + material material2 = material1 +)= material( + ior: material1.ior, + thin_walled: true, + geometry: material1.geometry, + volume: material1.volume, + surface: material1.surface, + backface: material2.surface +); + +// 3dsmax Physical Material +export material ad_3dsmax_physical_material +( + //====================================================================== + // Base Color + // + color base_color = color(.5) + [[ + anno::display_name("Color"), + anno::in_group("Base Color") + ]], + float base_weight = 1. + [[ + anno::display_name("Weight"), + anno::hard_range(0,1), + anno::in_group("Base Color") + ]], + float diff_roughness = 0. + [[ + anno::display_name("Roughness"), + anno::hard_range(0,1), + anno::in_group("Base Color") + ]], + // + //====================================================================== + + //====================================================================== + // Reflections + // + float reflectivity = 1. + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0,1), + anno::in_group("Reflections") + ]], + color refl_color = color(1.) + [[ + anno::display_name("Color"), + anno::in_group("Reflections") + ]], + float roughness = 0. + [[ + anno::display_name("Roughness"), + anno::hard_range(0,1), + anno::in_group("Reflections") + ]], + uniform bool roughness_inv = false + [[ + anno::display_name("Inverse Roughness"), + anno::in_group("Reflections") + ]], + float metalness = 0. + [[ + anno::display_name("Metalness"), + anno::hard_range(0,1), + anno::in_group("Reflections") + ]], + uniform float trans_ior = 1.52 + [[ + anno::display_name("IOR"), + anno::hard_range(0.1,50), + anno::in_group("Reflections") + ]], + // + //====================================================================== + + //====================================================================== + // Transparency + // + float transparency = 0. + [[ + anno::display_name("Transparency"), + anno::hard_range(0,1), + anno::in_group("Transparency") + ]], + color trans_color = color(1.) + [[ + anno::display_name("Color"), + anno::in_group("Transparency") + ]], + float trans_depth = 1. + [[ + anno::display_name("Depth"), + anno::unused(), + anno::hidden(), + anno::in_group("Transparency") + ]], + float trans_roughness = 0. + [[ + anno::display_name("Roughness"), + anno::hard_range(0,1), + anno::in_group("Transparency") + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin-walled"), + anno::in_group("Transparency") + ]], + uniform bool trans_roughness_inv = false + [[ + anno::display_name("Inverse Roughness"), + anno::in_group("Transparency") + ]], + uniform bool trans_roughness_lock = true + [[ + anno::display_name("Lock Roughness"), + anno::unused(), + anno::hidden(), + anno::in_group("Transparency") + ]], + // + //====================================================================== + + //====================================================================== + // Sub-surface scattering + // + uniform float scattering = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency") + ]], + uniform color sss_color = color(1.) + [[ + anno::display_name(""), + anno::in_group("Transparency") + ]], + uniform float sss_depth = 1. + [[ + anno::display_name(""), + anno::in_group("Transparency") + ]], + uniform float sss_scale = 1. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform color sss_scatter_color = color(1.) + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + // + //====================================================================== + + float anisotropy = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float anisoangle = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform float brdf_curve = 5. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform float brdf_high = 1. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform float brdf_low = 0.04 + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform bool brdf_mode = false + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float3 bump_map = state::normal() + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::hidden() + ]], + uniform float coat_affect_color = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform float coat_affect_roughness = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float3 coat_bump_map = state::normal() + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + color coat_color = color(1.) + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform float coat_ior = 1.5 + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float coat_roughness = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform bool coat_roughness_inv = false + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float coating = 1. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float cutout_map = 1. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float displacement = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float emission = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + color emit_color = color(0.) + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform int material_mode = 0 + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]] +) + = let +{ + //====================================================================== + // Base color + // + bsdf baseColor = df::diffuse_reflection_bsdf + ( + tint: base_color, + roughness: diff_roughness + ); + + bsdf diffuseLayer = df::weighted_layer + ( + weight: base_weight, + layer: baseColor, + base: df::diffuse_reflection_bsdf(tint:color(0)) + ); + // + //====================================================================== + + //====================================================================== + // Transparency + // + float transparencyRoughnessVal = trans_roughness_inv ? 1 - trans_roughness : trans_roughness; + + bsdf transparentLayer = df::simple_glossy_bsdf + ( + tint: trans_color, + roughness_u: transparencyRoughnessVal, + mode: df::scatter_transmit + ); + + bsdf transparentDiffuseMixer = df::weighted_layer + ( + weight: transparency, + layer: transparentLayer, + base: diffuseLayer + ); + // + //====================================================================== + + //====================================================================== + // Reflections Non Metal and Metal + // + float roughnessVal = roughness_inv ? 1 - roughness : roughness; + + bsdf reflections = df::simple_glossy_bsdf + ( + tint: refl_color, + roughness_u: roughnessVal, + mode: df::scatter_reflect + ); + + // Not reflective when roughness is 0 + // float reflectivityVal = (roughness == 0) ? 0 : reflectivity; + float reflectivityVal = reflectivity; + + bsdf reflectivity_layer = df::weighted_layer // Non-metal + ( + weight: reflectivityVal, + layer: reflections, + base: df::diffuse_reflection_bsdf(tint:color(1)) + ); + + bsdf reflectionLayerNonMetal = df::fresnel_layer + ( + ior: trans_ior, + layer: reflectivity_layer, + base: transparentDiffuseMixer + ); + + bsdf reflectionLayerMetal = df::fresnel_layer + ( + ior: trans_ior, + layer: reflectivity_layer, + base: diffuseLayer + ); + + // Metalness value. + // It mixes two shading modes. + // At 0, a non-metal diffuse model is used where the Base Color is taken as the diffuse color, with reflections added on top, with sub-surface scattering and transparency. + // At 1, a solely reflective metallic surface is rendered, reflecting the Base Color for facing angles, and the Reflection color (typically white) at the edges. + bsdf reflectionLayer = df::weighted_layer + ( + weight: metalness, + layer: reflectionLayerMetal, + base: reflectionLayerNonMetal + ); + // + //====================================================================== + + //====================================================================== + // Sub-surface scattering + // + float sss_scattering = scattering * (1 - transparency); // Ensure sss_scattering + transparency <= 1 + + material_volume materialVolume = material_volume( + scattering_coefficient: (sss_depth <= 0) ? color(0) : - math::log(color(1 - sss_scattering)) / sss_depth, + absorption_coefficient: (sss_depth <= 0) ? color(0) : - math::log(sss_color) / sss_depth + ); + // + //====================================================================== + + bsdf surface_bsdf = reflectionLayer; +} +in material +( + ior: color(trans_ior), + thin_walled: thin_walled, + surface: material_surface + ( + scattering: surface_bsdf + ), + volume: materialVolume, + geometry: material_geometry + ( + normal: bump_map + ) +); + +// 3dsmax Standard Material +export material ad_3dsmax_std_material( + color Diffuse = color(.9), + uniform bool dsLock = false + [[ + anno::unused() + ]], + color FilterColor = color(1.0) + [[ + anno::unused() + ]], + float glossiness = .9 + [[ + anno::unused() + ]], + uniform float ior = 1.5, + uniform float opacity = 1.0 + [[ + anno::unused() + ]], + uniform float opacityFallOff = 0. + [[ + anno::unused() + ]], + uniform int opacityFallOffType = 0 + [[ + anno::unused() + ]], + uniform int opacityType = 0 + [[ + anno::unused() + ]], + color selfIllumColor = color(0.) + [[ + anno::unused() + ]], + uniform float selfIllumAmount = 1. + [[ + anno::unused() + ]], + uniform int shaderType = 0 + [[ + anno::unused() + ]], + color Specular = color(1.) + [[ + anno::unused() + ]], + uniform float specularLevel = 1. + [[ + anno::unused() + ]], + float3 bump = state::normal() +) = material( + ior: color(ior), + surface: material_surface( + scattering: df::diffuse_reflection_bsdf(tint: Diffuse) + ), + geometry: material_geometry( + normal: bump + ) +); + +// 3dsmax Top/Bottom Material +export material ad_3dsmax_top_bottom +( + material top_material = material() + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Top material") + ]], + material bottom_material = top_material + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Bottom material") + ]], + uniform bool use_top_material = true + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Use top material") + ]], + uniform bool use_bottom_material = true + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Use bottom material") + ]], + uniform float blend = 0.f + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Blend"), + anno::hard_range(0.f, 100.f) + ]], + uniform float position = 50.f + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Position"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform int coordinates = 0 + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Coordinates"), + anno::hard_range(0, 1), + anno::unused(), + anno::hidden() + ]] +) += let +{ + float t = blend*0.01f; + + float3 normal_mix = math::normalize + ( + (use_top_material ? top_material.geometry.normal : state::normal())*t + + (use_bottom_material ? bottom_material.geometry.normal : state::normal())*(1.f - t) + ); + + bsdf bsdf_mix = + df::normalized_mix + ( + components: df::bsdf_component[] + ( + df::bsdf_component + ( + weight: 1.f - t, + component: use_top_material ? top_material.surface.scattering : bsdf() + ), + df::bsdf_component + ( + weight: t, + component: use_bottom_material ? bottom_material.surface.scattering : bsdf() + ) + ) + ); +} +in material +( + ior : use_top_material ? top_material.ior : color(1.f), + surface : material_surface(scattering: bsdf_mix), + geometry : material_geometry + ( + normal : normal_mix + ) +); + diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/vray_maps.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/vray_maps.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bb998de737e52ead3f83feae53df9cf6a2f1a2cc --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/vray_maps.mdl @@ -0,0 +1,943 @@ +// Copyright 2023 NVIDIA Corporation. All rights reserved. +// +// NVIDIA CORPORATION and its licensors retain all intellectual property +// and proprietary rights in and to this software, related documentation +// and any modifications thereto. Any use, reproduction, disclosure or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA CORPORATION is strictly prohibited. + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::math::*; +import ::state::*; +import ::tex::*; + +export using ::base import texture_return; + +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +{ + 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); +} + +// 3dsmax Bitmap Transformation Matrix +uniform float4x4 max_rotation_translation_scale +( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]], + uniform bool u_mirror = false + [[ anno::description("Mirror repeat has twice the number of textures in the same space") ]], + uniform bool v_mirror = false + [[ anno::description("Mirror repeat has twice the number of textures in the same space") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale") +]] +{ + float4x4 scale = + float4x4(u_mirror?scaling.x*2.:scaling.x , 0. , 0. , 0., + 0. , v_mirror?scaling.y*2.:scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + u_mirror?1.:.5 , v_mirror?1.:.5 , .5 , 1.); + + float4x4 translate = + float4x4(1. , 0. , 0. , 0., + 0. , 1. , 0. , 0., + 0. , 0. , 1. , 0., + -0.5-translation.x, -0.5-translation.y, -0.5-translation.z, 1.); + + + // Euler rotation matrix xyz order + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , c.y*s.z , -s.y , 0.0, + -c.x*s.z + s.x*s.y*c.z, c.x*c.z + s.x*s.y*s.z , s.x*c.y , 0.0, + s.x*s.z + c.x*s.y*c.z , -s.x*c.z + c.x*s.y*s.z, c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + return scale *rotate*translate; +} + +export enum vray_color_mode +[[ + anno::hidden() +]] +{ + mode_color, + mode_temperature +}; + +export enum vray_color_primaries +[[ + anno::hidden() +]] +{ + primaries_none, + primaries_sRGB, + primaries_ACEScg +}; + +export enum vray_bitmap_primaries +[[ + anno::hidden() +]] +{ + bm_primaries_default, + bm_primaries_sRGB, + bm_primaries_ACEScg, + bm_primaries_raw +}; + +export enum vray_rgb_output +[[ + anno::hidden() +]] +{ + rgb_output_rgb_color, + rgb_output_alpha_as_grey, + rgb_output_intensity_as_grey +}; + +export enum vray_mono_output +[[ + anno::hidden() +]] +{ + mono_output_rgb_intensity, + mono_output_alpha +}; + +export enum vray_alpha_source +[[ + anno::hidden() +]] +{ + alpha_source_image_alpha, + alpha_source_intensity, + alpha_source_opaque +}; + +// VRayBitmap map +export texture_return VRayBitmap +( + // UVW Coordinates + uniform int mapChannel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform bool U_Tile=true //it is actually an error if both mirror and tile are true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile") + ]], + uniform bool U_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile") + ]], + uniform bool V_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle") + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused(), + anno::hidden() + ]], + + // Bitmap + uniform texture_2d filename = texture_2d() + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bitmap") + ]], + uniform float multiplier = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Overall multiplier") + ]], + uniform vray_rgb_output rgb_output = rgb_output_rgb_color + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("RGB output") + ]], + uniform vray_mono_output mono_output = mono_output_rgb_intensity + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Mono output") + ]], + uniform vray_alpha_source alpha_source = alpha_source_image_alpha + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Alpha source") + ]], + uniform vray_bitmap_primaries rgb_primaries = bm_primaries_raw + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("RGB primaries"), + anno::unused(), + anno::hidden() + ]], + uniform bool crop_enable = false + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Crop") + ]], + uniform float crop_u = 0.f //u+w and v+h are always <=1.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("U Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_w = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("W Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_v = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("V Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_h = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("H Crop"), + anno::hard_range(0.f, 1.f) + ]], + + // Output + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output amount") + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB level") + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + uniform float clip_u = crop_enable ? crop_u : 0.f; + uniform float clip_w = crop_enable ? crop_w : 1.f; + uniform float clip_v = crop_enable ? crop_v : 0.f; + uniform float clip_h = crop_enable ? crop_h : 1.f; + + texture_return bitmap_sample = base::file_texture + ( + texture : filename, + mono_source : (alpha_source == alpha_source_image_alpha) ? base::mono_alpha : base::mono_average, + crop_u : float2(clip_u, clip_w + clip_u), + crop_v : float2(1.f - clip_v - clip_h, 1.f - clip_v), + uvw : base::transform_coordinate + ( + transform : max_rotation_translation_scale + ( + scaling : float3(U_Tiling, V_Tiling, 1.f), + rotation : float3(U_angle, V_angle, W_angle)/180.f*math::PI , + translation : float3(U_Offset, V_Offset, 0.f), u_mirror : U_Mirror, v_mirror : V_Mirror + ), + coordinate : base::coordinate_source(texture_space: mapChannel-1) + ), + wrap_u : U_Tile ? tex::wrap_repeat : U_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + wrap_v : V_Tile ? tex::wrap_repeat : V_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip + ); + + bitmap_sample.tint = invert ? + bitmap_sample.tint * (-rgb_level * output_amount * multiplier ) + (1.f - rgb_offset) : + bitmap_sample.tint * (rgb_level * output_amount * multiplier) + rgb_offset; + + float alpha = (alpha_source != alpha_source_opaque) ? bitmap_sample.mono : 1.f; + bitmap_sample.tint = bitmap_sample.tint*alpha; + + // determinate mono output + if(mono_output == mono_output_alpha) + bitmap_sample.mono = alpha; + else + bitmap_sample.mono = math::average(bitmap_sample.tint); + + // determinate rgb output + if(rgb_output == rgb_output_alpha_as_grey) + bitmap_sample.tint = color(alpha); + else if(rgb_output == rgb_output_intensity_as_grey) + bitmap_sample.tint = color(math::average(bitmap_sample.tint)); + + return bitmap_sample; +} +// VRayBitmap Map for Bump +export float3 VRayBitmap_bump +( + // UVW Coordinates + uniform int mapChannel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform bool U_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile") + ]], + uniform bool U_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile") + ]], + uniform bool V_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1. + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused() + ]], + + // Bitmap + uniform texture_2d filename = texture_2d() + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bitmap") + ]], + uniform bool crop_enable = false + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Crop") + ]], + uniform float crop_u = 0.f //u+w and v+h are always <=1.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("U Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_w = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("W Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_v = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("V Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_h = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("H Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float factor = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bump amount") + ]], + + // Output + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump output") + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB intensity"), + anno::unused() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output amount"), + anno::unused() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB level"), + anno::unused() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + uniform float clip_u = crop_enable ? crop_u : 0.f; + uniform float clip_w = crop_enable ? crop_w : 1.f; + uniform float clip_v = crop_enable ? crop_v : 0.f; + uniform float clip_h = crop_enable ? crop_h : 1.f; + + return base::file_bump_texture + ( + texture : filename, + crop_u : float2(clip_u, clip_w + clip_u), + crop_v : float2(1.f - clip_v - clip_h, 1.f - clip_v), + uvw : base::transform_coordinate + ( + transform : max_rotation_translation_scale + ( + scaling : float3(U_Tiling, V_Tiling, 1.f), + rotation : float3(U_angle, V_angle,W_angle)/(180.*math::PI), + translation : float3(U_Offset, V_Offset, 0.f), u_mirror : U_Mirror, v_mirror : V_Mirror + ), + coordinate : base::coordinate_source(texture_space: mapChannel - 1) + ), + wrap_u : U_Tile ? tex::wrap_repeat : U_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + wrap_v : V_Tile ? tex::wrap_repeat : V_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + factor : invert ? -10.f*factor*bump_amount : 10.f*factor*bump_amount + ); +} + +// VRayBump2Normal Map for Bump +export enum vray_bump2normal_mode +[[ + anno::hidden() +]] +{ + b2n_tangent_space, + b2n_local_XYZ, + b2n_screen_space, + b2n_world_space +}; + +export texture_return VRayBump2Normal +( + float3 bump_map = state::normal() + [[ + anno::in_group("Parameters"), + anno::display_name("Bump map") + ]], + uniform float bump_map_mult = 100.f + [[ + anno::in_group("Parameters"), + anno::display_name("Bump map multiplier"), + anno::hard_range(0.f, 100.f) + ]], + uniform vray_bump2normal_mode mode = b2n_tangent_space + [[ + anno::in_group("Parameters"), + anno::display_name("Mode"), + anno::unused(), + anno::hidden() + ]], + uniform int map_channel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + texture_return normal_tex; + + float3 normal_tangent_space = + transform_internal_to_tangent(math::normalize(state::normal() + (bump_map - state::normal())*(bump_map_mult*0.01f))); + + normal_tex.tint = color( (normal_tangent_space + float3(1.f))*0.5f ); + normal_tex.mono = 1.f; + return normal_tex; +} + +// VRayColor Map +export texture_return VRayColor +( + uniform vray_color_mode color_mode = mode_color + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Color mode") + ]], + uniform float temperature = 6500.f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Temperature"), + anno::hard_range(350.f, 1000000000.f) + ]], + uniform float red = 0.5f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Red"), + anno::soft_range(0.f, 1.f) + ]], + uniform float green = 0.5f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Green"), + anno::soft_range(0.f, 1.f) + ]], + uniform float blue = 0.5f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Blue"), + anno::soft_range(0.f, 1.f) + ]], + uniform float rgb_multiplier = 1.f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("RGB Multiplier") + ]], + uniform float alpha = 1.f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Alpha"), + anno::hard_range(0.f, 1.f) + ]], + uniform float color_gamma = 1.0f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Color gamma"), + anno::hard_range(0.05f, 20.f) + ]], + uniform vray_color_primaries rgb_primaries = primaries_none + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("RGB primaries"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 rgb(red, green, blue); + + // using temperature?. Then convert from Kelvin to RGB + if(color_mode == mode_temperature) + { + float k = temperature*0.01f; + + // red + if (temperature < 6600.f) + { + rgb.x = 1.f; + } + else + { + float r = k - 55.f; + r = (351.9769f + 0.1142f * r - 40.2537f * math::log(r))/255.f; + rgb.x = math::clamp(r, 0.f, 1.f); + } + + // green + if (temperature < 6600.f) + { + float g = k - 2.f; + g = (-155.2549f - 0.4460f * g + 104.4922f * math::log(g))/255.f; + rgb.y = math::clamp(g, 0.f, 1.f); + + } + else + { + float g = k - 50.f; + g = (325.4494f + 0.0794f * g - 28.0853f * math::log(g))/255.f; + rgb.y = math::clamp(g, 0.f, 1.f); + } + + // blue + if (temperature >= 6600.f) + { + rgb.z = 1.f; + } + else if (temperature <= 2000.f) + { + rgb.z = 0.f; + } + else + { + float b = k - 10.f; + b = (-254.7694f + 0.8274f * blue + 115.6799f * math::log(b))/255.f; + rgb.z = math::clamp(b, 0.f, 1.f); + } + } + + // apply gamma + if(color_gamma != 1.f) + rgb = math::pow(rgb, 1.f/color_gamma); + + // apply multiplier + rgb *= rgb_multiplier; + + // fix ranges and return + rgb = math::clamp(rgb, 0.f, 1.f); + return texture_return(color(rgb), alpha); +} + +// VRayColor Map for Bump +export float3 VRayColor_bump +( +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return state::normal(); +} + +// VRayColor2Bump Map for Bump +export float3 VRayColor2Bump_bump +( + float3 map = state::normal() + [[ + anno::in_group("Parameters"), + anno::display_name("Bump map") + ]], + uniform float height = 2.0f + [[ + anno::in_group("Parameters"), + anno::display_name("Height"), + anno::unused(), + anno::hidden() + ]], + uniform float bump_delta_scale = 1.0f + [[ + anno::in_group("Parameters"), + anno::display_name("Bump delta scale"), + anno::unused(), + anno::hidden(), + anno::hard_range(0.f, 1.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return map; +} + +// VRay Dirt Map +export texture_return VRayDirt +( + float radius = 10.f + [[ + anno::in_group("VRayDirt Parameters"), + anno::display_name("Radius"), + anno::unused(), + anno::hidden() + ]], + color occluded_color = color(0.f) + [[ + anno::in_group("VRayDirt Parameters"), + anno::display_name("Occluded color"), + anno::unused(), + anno::hidden() + ]], + color unoccluded_color = color(1.f) + [[ + anno::in_group("VRayDirt Parameters"), + anno::display_name("Unoccluded color") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return texture_return(unoccluded_color, 1.f); +} + +// VRay Edges Tex Map +export texture_return VRayEdgesTex +( + color edges_color = color(1.f) + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Color") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return texture_return(edges_color, 1.f); +} + +// VRay Edges Tex Map for bump +export float3 VRayEdgesTex_bump +( + color edges_color = color(1.f) + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Color"), + anno::unused(), + anno::hidden() + ]], + uniform float radius = 0.1f + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Radius"), + anno::hard_range(0.f, 100.f) + + ]], + uniform bool same_object_only = true + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Consider same object only") + ]], + uniform int corners_mode = 0 + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Corners"), + anno::unused(), + anno::hidden() + ]], + float multiplier = 1.f + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Multiplier"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return state::rounded_corner_normal(radius*state::meters_per_scene_unit(), !same_object_only); +} + +// VRay Normap Map for bump +export float3 VRayNormalMap_bump +( + texture_return normal_map = texture_return() + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Normal map") + ]], + float3 bump_map = state::normal() + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Bump map") + ]], + uniform float normal_amount = 1.f + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Normal amount"), + anno::hard_range(-1000.f, 1000.f) + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Bump amount"), + anno::hard_range(-1000.f, 1000.f) + ]], + uniform bool flip_red = false + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Flip red") + ]], + uniform bool flip_green = false + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Flip green") + ]], + uniform bool swap_rg = false + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Swap red and green") + ]], + uniform int map_channel = 1 + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Map channel"), + anno::hidden(), + anno::unused() + ]], + uniform float map_rotation = 0.f + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Map rotation"), + anno::hard_range(0.f, 360.f), + anno::hidden(), + anno::unused() + ]], + uniform float normal_map_amount = 1.0f + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Map amount"), + anno::hard_range(-10.f, 10.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 tangent_space_normal = float3(normal_map.tint); + + if(flip_red) + tangent_space_normal.x = 1.f - tangent_space_normal.x; + + if(flip_green) + tangent_space_normal.y = 1.f - tangent_space_normal.y; + + if(swap_rg) + { + float tmp = tangent_space_normal.x; + tangent_space_normal.x = tangent_space_normal.y; + tangent_space_normal.y = tmp; + } + + float normal_factor = normal_amount*(normal_map_amount); + tangent_space_normal = (tangent_space_normal - float3(0.5f))*(2.f*normal_factor); + + float3 mapped_normal = math::normalize( + state::texture_tangent_u(0) * tangent_space_normal.x + + state::texture_tangent_v(0) * tangent_space_normal.y + + state::normal() * (tangent_space_normal.z + (1.f - normal_factor))); + + float3 bumped_normal = math::normalize(math::lerp(state::normal(), bump_map, bump_amount*normal_map_amount)); + + return math::normalize(mapped_normal + bumped_normal); +} diff --git a/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/vray_materials.mdl b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/vray_materials.mdl new file mode 100644 index 0000000000000000000000000000000000000000..675352a72d64f7202b476d08e87ac34f5e8f34b6 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/install_gear/merge_usd/0009/Materials/templates/vray_materials.mdl @@ -0,0 +1,1723 @@ +// Copyright 2023 NVIDIA Corporation. All rights reserved. +// +// NVIDIA CORPORATION and its licensors retain all intellectual property +// and proprietary rights in and to this software, related documentation +// and any modifications thereto. Any use, reproduction, disclosure or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA CORPORATION is strictly prohibited. + +mdl 1.6; + +import ::anno::*; +import ::df::*; +import ::df::color_weighted_layer; +import ::math::*; +import ::state::*; + +// VRay 2-Sided Material +export material VRay2SidedMtl +( + material frontMtl = material() + [[ + anno::in_group("Parameters"), + anno::display_name("Front material") + ]], + material backMtl = frontMtl + [[ + anno::in_group("Parameters"), + anno::display_name("Back material") + ]], + uniform bool use_backMtl = false + [[ + anno::in_group("Parameters"), + anno::display_name("Use back material") + ]], + color translucency = color(.5f) + [[ + anno::in_group("Basic parameters"), + anno::display_name("Translucency") + ]], + color front_tint = color(1.f) + [[ + anno::in_group("Parameters"), + anno::display_name("Front tint"), + anno::hidden() + ]], + color back_tint = color(1.f) + [[ + anno::in_group("Parameters"), + anno::display_name("Back tint"), + anno::hidden() + ]], + uniform bool multiply_by_front_diffuse = false + [[ + anno::in_group("Basic parameters"), + anno::display_name("Multiply by front diffuse"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + bsdf transmission_bsdf = + df::diffuse_transmission_bsdf(tint: (front_tint + back_tint)*0.5f); + + + bsdf front_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : frontMtl.surface.scattering + ); + + bsdf back_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : backMtl.surface.scattering + ); + +} +in material +( + ior: frontMtl.ior, + thin_walled: true, + geometry: frontMtl.geometry, + volume: frontMtl.volume, + surface: material_surface(scattering: front_bsdf), + backface: material_surface(scattering: use_backMtl ? back_bsdf : front_bsdf) +); + +// VRay Blend - Default clear material for unused coat slots +export material clear_material() += material +( + ior : color(1.0), + surface : material_surface(df::specular_bsdf(mode: df::scatter_transmit)), + geometry: material_geometry(cutout_opacity: 0.0) +); + +// VRay Blend Material +export material VRayBlendMtl( + material base_mtl = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("Base material") + ]], + + uniform bool enabled1 = false + [[ + anno::in_group("Parameters"), + anno::display_name("1: Enable") + ]], + material coat_mtl1 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("1: Coat material") + ]], + color blend_amount1 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("1: Blend amount") + ]], + + uniform bool enabled2 = false + [[ + anno::in_group("Parameters"), + anno::display_name("2: Enable") + ]], + material coat_mtl2 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("2: Coat material") + ]], + color blend_amount2 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("2: Blend amount") + ]], + + uniform bool enabled3 = false + [[ + anno::in_group("Parameters"), + anno::display_name("3: Enable") + ]], + material coat_mtl3 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("3: Coat material") + ]], + color blend_amount3 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("3: Blend amount") + ]], + + uniform bool enabled4 = false + [[ + anno::in_group("Parameters"), + anno::display_name("4: Enable") + ]], + material coat_mtl4 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("4: Coat material") + ]], + color blend_amount4 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("4: Blend amount") + ]], + + uniform bool enabled5 = false + [[ + anno::in_group("Parameters"), + anno::display_name("5: Enable") + ]], + material coat_mtl5 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("5: Coat material") + ]], + color blend_amount5 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("5: Blend amount") + ]], + + uniform bool enabled6 = false + [[ + anno::in_group("Parameters"), + anno::display_name("6: Enable") + ]], + material coat_mtl6 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("6: Coat material") + ]], + color blend_amount6 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("6: Blend amount") + ]], + + uniform bool enabled7 = false + [[ + anno::in_group("Parameters"), + anno::display_name("7: Enable") + ]], + material coat_mtl7 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("7: Coat material") + ]], + color blend_amount7 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("7: Blend amount") + ]], + + uniform bool enabled8 = false + [[ + anno::in_group("Parameters"), + anno::display_name("8: Enable") + ]], + material coat_mtl8 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("8: Coat material") + ]], + color blend_amount8 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("8: Blend amount") + ]], + + uniform bool enabled9 = false + [[ + anno::in_group("Parameters"), + anno::display_name("9: Enable") + ]], + material coat_mtl9 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("9: Coat material") + ]], + color blend_amount9 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("9: Blend amount") + ]], + + uniform bool additive = false + [[ + anno::in_group("Parameters"), + anno::display_name("Additive mode") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + color white(1.0); + color black(0.0); + + bsdf additive_bsdf = + df::color_normalized_mix + ( + components: df::color_bsdf_component[] + ( + df::color_bsdf_component + ( + weight: white, + component: base_mtl.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled1 ? blend_amount1 * coat_mtl1.geometry.cutout_opacity : black, + component: coat_mtl1.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled2 ? blend_amount2 * coat_mtl2.geometry.cutout_opacity : black, + component: coat_mtl2.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled3 ? blend_amount3 * coat_mtl3.geometry.cutout_opacity : black, + component: coat_mtl3.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled4 ? blend_amount4 * coat_mtl4.geometry.cutout_opacity : black, + component: coat_mtl4.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled5 ? blend_amount5 * coat_mtl5.geometry.cutout_opacity : black, + component: coat_mtl5.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled6 ? blend_amount6 * coat_mtl6.geometry.cutout_opacity : black, + component: coat_mtl6.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled7 ? blend_amount7 * coat_mtl7.geometry.cutout_opacity : black, + component: coat_mtl7.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled8 ? blend_amount8 * coat_mtl8.geometry.cutout_opacity : black, + component: coat_mtl8.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled9 ? blend_amount9 * coat_mtl9.geometry.cutout_opacity : black, + component: coat_mtl9.surface.scattering + ) + ) + ); + + bsdf blend_bsdf = + df::color_weighted_layer + ( + weight: enabled9 ? blend_amount9 * coat_mtl9.geometry.cutout_opacity : black, + layer: coat_mtl9.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled8 ? blend_amount8 * coat_mtl8.geometry.cutout_opacity : black, + layer: coat_mtl8.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled7 ? blend_amount7 * coat_mtl7.geometry.cutout_opacity : black, + layer: coat_mtl7.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled6 ? blend_amount6 * coat_mtl6.geometry.cutout_opacity : black, + layer: coat_mtl6.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled5 ? blend_amount5 * coat_mtl5.geometry.cutout_opacity : black, + layer: coat_mtl5.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled4 ? blend_amount4 * coat_mtl4.geometry.cutout_opacity : black, + layer: coat_mtl4.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled3 ? blend_amount3 * coat_mtl3.geometry.cutout_opacity : black, + layer: coat_mtl3.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled2 ? blend_amount2 * coat_mtl2.geometry.cutout_opacity : black, + layer: coat_mtl2.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled1 ? blend_amount1 * coat_mtl1.geometry.cutout_opacity : black, + layer: coat_mtl1.surface.scattering, + base: base_mtl.surface.scattering + ) + ) + ) + ) + ) + ) + ) + ) + ); + + bsdf surface_bsdf = additive ? additive_bsdf : blend_bsdf; + +} in material +( + ior : base_mtl.ior, + surface : material_surface(scattering: surface_bsdf) +); + +// VRay Car Paint + +// constants for numerical fitted curve to observed flake noise density behavior +// 1. no jitter, maximum flake diameter +const float4 ABCD = float4(-26.19771808f, 26.39663835f, 85.53857017f, -102.35069432f); +const float2 EF = float2(-101.42634862f, 118.45082288f); +// 2. jitter scale of 0.5f, maximum flake diameter +const float4 ABCD_J = float4(-0.87962159f, 0.91006603f, 0.76088203f, -0.24953308f); +const float2 EF_J = float2(-3.11456809f, 2.63430594f); + +// +// flake noise utilities +// +int hash(int seed, int i) +{ + return (i ^ seed) * 1075385539; +} + +int rnd_init(int3 pos) +{ + return hash(hash(hash(0, pos.x), pos.y), pos.z); +} + +int rnd_next(int seed) +{ + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + return math::abs(float(seed) * 4.6566e-10f); +} + +struct flake_noise_value +{ + // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them) + float priority; + + // current pseudo random number generator seed + int rnd_seed; +}; + +// apply random rotation (using "Fast Random Rotation Matrices" by James Arvo) +float3 rotate_pos(float3 pos, float3 xi) +{ + float theta = math::PI * 2.0f * xi.x; + float phi = math::PI * 2.0f * xi.y; + float z = xi.z * 2.0f; + + float r = math::sqrt(z); + float[2] sp_cp = math::sincos(phi); + float Vx = sp_cp[0] * r; + float Vy = sp_cp[1] * r; + float Vz = math::sqrt(2.0f - z); + + float[2] st_ct = math::sincos(theta); + float Sx = Vx * st_ct[1] - Vy * st_ct[0]; + float Sy = Vx * st_ct[0] + Vy * st_ct[1]; + + float3x3 M( + Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz, + Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz, + Vz * Sx, Vz * Sy, 1.0f - z); + + return M * pos; +} + +// create a flake normal by importance sampling the Beckmann distribution with given roughness +float3 flake_normal +( + flake_noise_value val, + float spread +) +{ + if (val.priority <= 0.0f) + return state::normal(); + + int seed0 = rnd_next(val.rnd_seed); + float xi0 = rnd_value(seed0); + float xi1 = rnd_value(rnd_next(seed0)); + + float phi = math::PI * 2.0f * xi0; + + float roughness = spread * spread; + + float tantheta = math::sqrt(-roughness * roughness * math::log(1.0f - xi1)); + float sintheta = tantheta / math::sqrt(1.0f + tantheta * tantheta); + float costheta = math::sqrt(1.0f - sintheta * sintheta); + + float[2] scphi = math::sincos(phi); + return + state::texture_tangent_u(0) * scphi[1] * sintheta + + state::texture_tangent_v(0) * scphi[0] * sintheta + + state::normal() * costheta; +} + +// compute a flake probability for a given flake coverage density x +float density_to_probability +( + float4 abcd, + float2 ef, + float x +) +{ + float xx = x * x; + return (abcd.x * xx + abcd.y * x) / (abcd.z * xx * x + abcd.w * xx + ef.x * x + ef.y); +} + +// Flake noise function with controllable regularity, flake size, and probability +flake_noise_value flake_noise +( + float3 pos, + float jitter_scale = 1.0f, + float flake_diameter = 0.75f, + float flake_probability = 1.0f, + int seed_offset = 1 +) +{ + float3 base_pos = math::floor(pos); + int3 base_pos_i = int3(base_pos); + + // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient) + flake_diameter = math::min(flake_diameter, (3.f - 0.5f * jitter_scale) / math::sqrt(3.0f)); + + flake_noise_value val(0.0f, 0); + + for (int i = -1; i < 2; ++i) + { + for (int j = -1; j < 2; ++j) + { + for (int k = -1; k < 2; ++k) + { + int seed = rnd_init((base_pos_i + int3(i, j, k)) + seed_offset); + + seed = rnd_next(seed); + if (rnd_value(seed) > flake_probability) + continue; + + seed = rnd_next(seed); + float priority = rnd_value(seed); + if (priority < val.priority) + continue; + + float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f); + + if (jitter_scale > 0.0f) + { + seed = rnd_next(seed); + flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale; + } + + float3 p = pos - flake_pos; + if (math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f) + continue; + + float3 xi_rot; + seed = rnd_next(seed); + xi_rot.x = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.y = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.z = rnd_value(seed); + p = rotate_pos(p, xi_rot); + + if (math::abs(p.x) <= flake_diameter && + math::abs(p.y) <= flake_diameter && + math::abs(p.z) <= flake_diameter) + { + val.priority = priority; + val.rnd_seed = seed; + } + } + } + } + + return val; +} + +// Statistically controlled (area/volume coverage density) flake noise +flake_noise_value flake_noise +( + float3 position, + float diameter, + float density = 0.5f, + int seed_offset = 1, + bool jittered = false +) +{ + float probability = density_to_probability(jittered ? ABCD_J : ABCD, jittered ? EF_J : EF, density); + + return flake_noise + ( + pos : position, + jitter_scale : jittered ? 0.5f : 0.0f, + flake_diameter : (jittered ? 2.5f*diameter : 3.0f*diameter) / math::sqrt(3.0f), + flake_probability : probability, + seed_offset : seed_offset + ); +} + +export material VRayCarPaintMtl +( + // Base layer + color base_color = color(0.3f, 0.4f, 0.5f) + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base color") + ]], + float base_reflection = 0.5f + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base reflection"), + anno::hard_range(0.f, 1.f) + ]], + float base_glossiness = 0.6f + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool base_trace_reflections = true + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base trace reflections"), + anno::unused(), + anno::hidden() + ]], + + // Flake layer + color flake_color = color(0.3f, 0.4f, 0.8f) + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake color") + ]], + float flake_glossiness = 0.8f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake glossiness"), + anno::hard_range(0.f, 1.f) + ]], + float flake_orientation = 0.3f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake orientation"), + anno::hard_range(0.f, 1.f) + ]], + uniform float flake_density = 0.5f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake density"), + anno::hard_range(0.f, 4.f) + ]], + uniform float flake_scale = 0.01f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake scale"), + anno::hard_range(0.f, 1.0e10f) + ]], + uniform float flake_size = 0.5f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake size"), + anno::hard_range(0.f, 1.0e10f) + ]], + uniform int flake_seed = 1 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake seed"), + anno::hard_range(1, 65535) + ]], + uniform int flake_filtering = 1 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake filtering"), + anno::unused(), + anno::hidden() + ]], + uniform int flake_map_size = 1024 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake map size"), + anno::unused(), + anno::hidden() + ]], + uniform int flake_mapping_type = 0 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake mapping type") + ]], + uniform int flake_map_channel = 1 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake map channel") + ]], + uniform bool flake_trace_reflections = true + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake trace reflections"), + anno::unused(), + anno::hidden() + ]], + + + // Coat layer + color coat_color = color(1.0f) + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat color") + ]], + float coat_strength = 0.05f + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat strength"), + anno::hard_range(0.f, 1.f) + ]], + float coat_glossiness = 1.0f + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool coat_trace_reflections = true + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat trace reflections"), + anno::unused(), + anno::hidden() + ]], + + // Options + uniform bool double_sided = true + [[ + anno::in_group("Options"), + anno::display_name("Double sided") + ]], + + // Maps + float3 base_bump_map = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float3 coat_bump_map = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Coat Map") + ]], + + float displacement_map = 0.f + [[ + anno::in_group("Maps"), + anno::display_name("Displacement map") + ]] + +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + // sample flake distribution + flake_noise_value val = (flake_mapping_type == 1) ? + flake_noise(state::position() / flake_scale, flake_size*0.5f, flake_density/8.f, flake_seed, true) : + flake_noise(state::texture_coordinate(flake_map_channel - 1) / flake_scale, flake_size*0.5f, flake_density/2.f, flake_seed, true); + + bool is_flake = (flake_mapping_type == 1) ? + flake_density/8.f >= 1.0f || val.priority > 0.0f : + flake_density/2.f >= 1.0f || val.priority > 0.0f; + + // Base layer BSDF + bsdf base_bsdf = + df::fresnel_layer + ( + ior : 1.5f, + weight : base_reflection, + layer : df::microfacet_ggx_smith_bsdf + ( + roughness_u : (1.f - base_glossiness)*(1.f - base_glossiness) + ), + base : df::diffuse_reflection_bsdf + ( + tint : base_color + ), + normal : base_bump_map + ); + + // Flakes BSDF + bsdf flake_bsdf = + df::microfacet_ggx_smith_bsdf + ( + tint : flake_color, + roughness_u : (1.f - flake_glossiness)*(1.f - flake_glossiness) + ); + + bsdf surface_bsdf = + df::weighted_layer + ( + weight : is_flake ? 1.0f : 0.0f, + normal : flake_normal(val, flake_orientation*0.5f), + layer : flake_bsdf, + base : base_bsdf + ); + + + // Coat layer bsdf + bsdf coat_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : coat_color*coat_strength, + grazing_reflectivity: coat_color, + layer : df::microfacet_ggx_smith_bsdf + ( + roughness_u : (1.f - coat_glossiness)*(1.f - coat_glossiness) + ), + base : surface_bsdf, + normal : coat_bump_map + ); + +} in material +( + thin_walled : double_sided, + surface : material_surface(scattering : coat_bsdf), + backface : double_sided ? material_surface(scattering: coat_bsdf) : material_surface(), + geometry : material_geometry(displacement: state::normal()*(displacement_map)) +); + +export material VRayCarPaintMtl2 +( + // Base layer + color base_color = color(0.3f, 0.4f, 0.5f) + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base color") + ]], + float base_reflection = 0.5f + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base reflection"), + anno::hard_range(0.f, 1.f) + ]], + float base_glossiness = 0.4f + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base glossiness"), + anno::hard_range(0.f, 1.f) + ]], + float base_glossiness_tail = 2.0f + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base glossiness tail"), + anno::hard_range(0.001f, 1000.f), + anno::unused(), + anno::hidden() + ]], + uniform bool base_trace_reflections = true + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base trace reflections"), + anno::unused(), + anno::hidden() + ]], + + // Flake layer + color flake_color = color(0.3f, 0.4f, 0.8f) + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake color") + ]], + color flake_random_color = color(0.3f, 0.4f, 0.8f) + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake random color"), + anno::unused(), + anno::hidden() + ]], + float flake_orientation = 0.05f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake orientation"), + anno::hard_range(0.f, 1.f) + ]], + uniform float flake_orientation_tail = 2.0f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake orientation tail"), + anno::hard_range(0.01f, 1000.f), + anno::unused(), + anno::hidden() + ]], + uniform float flake_glossiness = 0.9f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float flake_density = 4.0f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake density"), + anno::hard_range(0.f, 7.f) + ]], + uniform float flake_uvw_scale = 1.0f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake UVW scale"), + anno::hard_range(0.f, 1.0e10f), + anno::enable_if("flake_mapping_type == 0") + ]], + uniform float flake_object_xyz_scale = 1.0f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake Object XYZ scale"), + anno::hard_range(0.f, 1.0e10f), + anno::enable_if("flake_mapping_type == 1") + ]], + uniform float flake_size = 0.5f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake size"), + anno::hard_range(0.f, 1.0e10f) + ]], + uniform int flake_seed = 1 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake seed"), + anno::hard_range(1, 65535) + ]], + uniform int flake_map_size = 2048 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake map size"), + anno::unused(), + anno::hidden() + ]], + uniform int flake_mapping_type = 0 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake mapping type"), + anno::hard_range(0, 1) + ]], + uniform int flake_map_channel = 1 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake map channel") + ]], + uniform bool flake_trace_reflections = true + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake trace reflections"), + anno::unused(), + anno::hidden() + ]], + + // Coat layer + color coat_color = color(1.0f) + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat color") + ]], + float coat_amount = 1.0f + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat amount"), + anno::hard_range(0.f, 1.f) + ]], + float coat_ior = 1.5f + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat IOR"), + anno::hard_range(0.f, 100.f) + ]], + float coat_glossiness = 1.0f + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool coat_trace_reflections = true + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat trace reflections"), + anno::unused(), + anno::hidden() + ]], + + // Options + uniform bool double_sided = true + [[ + anno::in_group("Options"), + anno::display_name("Double sided") + ]], + + // Maps + float3 base_bump_map = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float3 coat_bump_map = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Coat Map") + ]], + + float displacement_map = 0.f + [[ + anno::in_group("Maps"), + anno::display_name("Displacement map") + ]] + +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + // sample flake distribution + flake_noise_value val = (flake_mapping_type == 1) ? + // Object XYZ + flake_noise(state::position() / flake_object_xyz_scale*2.f, flake_size*0.8f, flake_density/7.f, flake_seed, true) : + // UVW + flake_noise(state::texture_coordinate(flake_map_channel - 1) / flake_uvw_scale*2000.0f, flake_size*0.8f, flake_density/7.f, flake_seed, true); + + bool is_flake = flake_density/7.f >= 1.0f || val.priority > 0.0f; + + // Base layer BSDF + bsdf base_bsdf = + df::fresnel_layer + ( + ior : 1.5f, + weight : base_reflection, + layer : df::microfacet_ggx_smith_bsdf + ( + roughness_u : (1.f - base_glossiness)*(1.f - base_glossiness) + ), + base : df::diffuse_reflection_bsdf + ( + tint : base_color + ), + normal : base_bump_map + ); + + // Flakes BSDF + bsdf flake_bsdf = + df::microfacet_ggx_smith_bsdf + ( + tint : flake_color, + roughness_u : (1.f - flake_glossiness)*(1.f - flake_glossiness) + ); + + bsdf surface_bsdf = + df::weighted_layer + ( + weight : is_flake ? 1.0f : 0.0f, + normal : flake_normal(val, flake_orientation*0.5f), + layer : flake_bsdf, + base : base_bsdf + ); + + bsdf coat_bsdf = + df::fresnel_layer + ( + ior : coat_ior, + // ior : invert_coat_ior ? 1.f/(coat_ior + 0.01f) : coat_ior, + weight : coat_amount, + layer : df::simple_glossy_bsdf + ( + tint : color(1.0f), + roughness_u : (1.f - coat_glossiness)*(1.f - coat_glossiness), + mode : df::scatter_reflect + ), + //base : surface_bsdf, + base : df::tint + ( + tint : coat_color,//math::lerp(color(1.f), coat_color, coat_amount), + base : surface_bsdf + ), + normal : coat_bump_map + ); + +} in material +( + thin_walled : double_sided, + surface : material_surface(scattering : coat_bsdf), + backface : double_sided ? material_surface(scattering: coat_bsdf) : material_surface(), + geometry : material_geometry(displacement: state::normal()*(displacement_map)) +); + +// VRay Light Material +export material VRayLightMtl +( + color emission = color(1.0) + [[ + anno::in_group("Parameters"), + anno::display_name("Emission") + ]], + uniform float emission_mult = 1.0 + [[ + anno::in_group("Parameters"), + anno::display_name("Mutliplier") + ]], + color opacity = color(1.0) + [[ + anno::in_group("Parameters"), + anno::display_name("Opacity") + ]], + uniform bool emit_on_backside = false + [[ + anno::in_group("Parameters"), + anno::display_name("Emit light on back side") + ]], + uniform bool mult_emission_by_opacity = false + [[ + anno::in_group("Parameters"), + anno::display_name("Mutliply emission by opacity") + ]], + float displacement = 0.f + [[ + anno::in_group("Parameters"), + anno::display_name("Displacement") + ]], + uniform float displace_amnt = 1.f + [[ + anno::in_group("Parameters"), + anno::display_name("Displacement amount") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + color emission_color = mult_emission_by_opacity ? + (emission*opacity*opacity)*emission_mult : + (emission*opacity)*emission_mult; + + bsdf surface_bsdf = + df::simple_glossy_bsdf + ( + mode: df::scatter_transmit, + tint: color(1.f) - opacity, + roughness_u: 0 + ); + + material_surface emit_surface = material_surface( + scattering: surface_bsdf, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: emission_color)); +} in material +( + ior : color(1.0), + thin_walled : emit_on_backside, + surface : emit_surface, + backface : emit_on_backside ? emit_surface : material_surface(), + geometry : material_geometry( + displacement: state::normal()*(displacement*displace_amnt)) +); + +// VRay Material - Translucency Mode +export enum VRay_translucency_mode +[[ + anno::hidden() +]] +{ + translucency_none, + translucency_hard,//all modes will likely trigger the same mdl code but value might be usefull for other means + translucency_soft, + translucency_hybrid +}; + +// VRay Material - BRDF Mode +export enum VRay_brdf_mode +[[ + anno::hidden() +]] +{ + brdf_phong, + brdf_blinn, + brdf_ward, + brdf_ggx +}; + +// VRay Material - Glossy Mode +export enum VRay_brdf_glossy_mode +[[ + anno::hidden() +]] +{ + brdf_roughness, + brdf_glossiness +}; + +// VRay Material +export material VRayMtl( + color Diffuse = color(0.5f) + [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("Diffuse") + ]], + uniform float diffuse_roughness = 0.f + [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("Roughness"), + anno::hard_range(0.f, 1.f) + ]], + + color Reflection = color(0.f) + [[ + anno::in_group("Reflections"), + anno::display_name("Reflect") + ]], + float reflection_glossiness = 1.f + [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool reflection_fresnel = true + [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float reflection_ior = 1.6f + [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.e-6f, 100.f) + ]], + uniform bool reflection_lockIOR = true + [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false + [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f + [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + + color Refraction = color(0.f) + [[ + anno::in_group("Refractions"), + anno::display_name("Refract") + ]], + float refraction_glossiness = 1.f + [[ + anno::in_group("Refractions"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refraction_ior = 1.6f // not textureable to be physically plausible + [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2,5.), + anno::hard_range(1.e-6f, 100.f) + ]], + uniform bool invert_refraction_ior = false + [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + uniform bool refraction_dispersion_on = false + [[ + anno::in_group("Refractions"), + anno::display_name("Enable dispersion"), + anno::unused(), + anno::hidden() + ]], + uniform float refraction_dispersion = 50.f + [[ + anno::in_group("Refractions"), + anno::display_name("Abbe number"), + anno::soft_range(10.f, 100.f), + anno::hard_range(1.f, 150.f), + anno::unused(), + anno::hidden() + ]], + + color refraction_fogColor = color(1.f) + [[ + anno::in_group("Fog"), + anno::display_name("Color"), + anno::unused(), + anno::hidden() + ]], + uniform float refraction_fogBias = 0.f + [[ + anno::in_group("Fog"), + anno::display_name("Bias"), + anno::unused(), + anno::hidden() + ]], + uniform float refraction_fogMult = 1.f + [[ + anno::in_group("Fog"), + anno::display_name("Multiplier"), + anno::unused(), + anno::hidden() + ]], + + uniform VRay_translucency_mode translucency_on = translucency_none + [[ + anno::in_group("Translucency"), + anno::display_name("Enable translucency"), + anno::unused(), + anno::hidden() + ]], + uniform float translucency_scatterCoeff = 0.f + [[ + anno::in_group("Translucency"), + anno::display_name("Scatter coeff"), + anno::unused(), + anno::hidden() + ]], + uniform float translucency_fbCoeff = 1.f + [[ + anno::in_group("Translucency"), + anno::display_name("Fwd/Bck coeff"), + anno::unused(), + anno::hidden() + ]], + uniform color translucency_color = color(1.f) + [[ + anno::in_group("Translucency"), + anno::display_name("Back-side color"), + anno::unused(), + anno::hidden() + ]], + + color self_illumination = color(0.f) + [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f + [[ + anno::in_group("Self-Illumination"), + anno::display_name("Multiplier") + ]], + + float coat_amount = 0.f + [[ + anno::in_group("Coat Parameters"), + anno::display_name("Coat amount"), + anno::hard_range(0.f, 1.f) + ]], + color coat_color = color(1.f) + [[ + anno::in_group("Coat Parameters"), + anno::display_name("Coat color") + ]], + float coat_glossiness = 1.f + [[ + anno::in_group("Coat Parameters"), + anno::display_name("Coat glossiness"), + anno::hard_range(0.f, 1.f) + ]], + float coat_ior = 1.6f + [[ + anno::in_group("Coat Parameters"), + anno::display_name("Coat IOR"), + anno::soft_range(0.2,5.), + anno::hard_range(1.e-6f, 100.f) + ]], + uniform bool invert_coat_ior = false + [[ + anno::in_group("Coat Parameters"), + anno::hidden() + ]], + bool coat_bump_lock = false + [[ + anno::in_group("Coat Parameters"), + anno::display_name("lock coat bump to base bump") + ]], + + color sheen_color = color(0.f) + [[ + anno::in_group("Sheen Parameters"), + anno::display_name("Sheen color"), + anno::unused(), + anno::hidden() + ]], + float sheen_glossiness = 0.8f + [[ + anno::in_group("Sheen Parameters"), + anno::display_name("Sheen glossiness"), + anno::hard_range(0.f, 1.f), + anno::unused(), + anno::hidden() + ]], + + uniform VRay_brdf_mode brdf_type = brdf_ggx + [[ + anno::in_group("BRDF"), + anno::display_name("BRDF type"), + anno::unused(), + anno::hidden() + ]], + uniform VRay_brdf_glossy_mode brdf_useRoughness = brdf_glossiness + [[ + anno::in_group("BRDF"), + anno::display_name("BRDF glossiness"), + anno::hidden() + ]], + float anisotropy = 0.f + [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f + [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + uniform int anisotropy_channel = 0 //=1 in max + [[ + anno::in_group("BRDF"), + anno::display_name("Map channel"), + anno::unused(), + anno::hidden() + ]], + + float3 texmap_bump = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float3 texmap_coat_bump = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Coat Map") + ]], + float texmap_opacity = 1.0f + [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + + uniform bool thin_walled = false + [[ + anno::in_group("Options"), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] + = let + { + float reflection_roughness = brdf_useRoughness == brdf_roughness ? + reflection_glossiness : math::pow((1.f - reflection_glossiness), 2.f); + + float refraction_roughness = brdf_useRoughness == brdf_roughness ? + refraction_glossiness : math::pow((1.f - refraction_glossiness), 2.f); + + + float refl_ior = invert_reflection_ior ? 1.f/(reflection_ior + 0.01f) : reflection_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refraction_ior + 0.01f) : refraction_ior; + + float fresnel_ior = reflection_lockIOR ? refr_ior : refl_ior; + float R0 = math::pow((1.f - fresnel_ior)/(1.f + fresnel_ior), 2.f); + + // diffuse + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : Diffuse, + roughness : diffuse_roughness + ), + normal : texmap_bump + ); + + // transmission + bsdf glossy_transmission_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: color(1.f), + roughness_u: refraction_roughness + ); + + // reflection + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: reflection_fresnel ? Reflection : color(1.f), + roughness_u: reflection_roughness + ); + + // diffuse glossy reflection + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: Diffuse, + roughness_u: reflection_roughness + ); + + // surface + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : reflection_fresnel ? color(R0) : Reflection, + grazing_reflectivity: reflection_fresnel ? color(1.f) : Reflection, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : + df::color_weighted_layer + ( + weight : Refraction, + layer : glossy_transmission_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ), + normal : texmap_bump + ); + + // coat + bsdf coat_bsdf = + df::fresnel_layer + ( + ior : invert_coat_ior ? 1.f/(coat_ior + 0.01f) : coat_ior, + weight : coat_amount, + layer : df::simple_glossy_bsdf + ( + tint : color(1.f), + roughness_u : math::pow((1.f - coat_glossiness), 2.f), + mode : df::scatter_reflect + ), + base : df::tint + ( + tint : math::lerp(color(1.f), coat_color, coat_amount), + base : surface_bsdf + ), + normal : coat_bump_lock ? texmap_bump : texmap_coat_bump + ); + +} +in material +( + ior : color(refr_ior), + thin_walled : thin_walled, + surface : material_surface + ( + scattering : coat_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry + ( + cutout_opacity: texmap_opacity + ) +); + +// VRay-Fast-SSS-2 Material +export material VRayFastSSS2 +( + // General parameters + uniform float scale = 1.f + [[ + anno::in_group("General Parameters"), + anno::display_name("Scale"), + anno::hard_range(0.f, 10000.f) + ]], + uniform float ior = 1.3f + [[ + anno::in_group("General Parameters"), + anno::display_name("IOR"), + anno::hard_range(0.f, 100.f) + ]], + + // Diffuse and SSS Layers + color overall_color = color(1.f) + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Overall color") + ]], + color diffuse_color = color(0.5f) + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Diffuse color") + ]], + float diffuse_amnt = 0.f + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Diffuse amount"), + anno::hard_range(0.f, 1.f) + ]], + uniform int color_mode = 0 + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Color mode"), + anno::unused(), + anno::hidden() + ]], + color sub_surface_color = color(0.5f) + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Sub-surface color") + ]], + color scatter_color = color(0.5f) + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Scatter color") + ]], + float scatter_radius = 1.f + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Scatter radius") + ]], + uniform float phase_function = 0.f + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Phase function"), + anno::hard_range(-1.f, 1.f) + ]], + + // Specular Layer + color specular_color = color(1.f) + [[ + anno::in_group("Specular Layer"), + anno::display_name("Specular color") + ]], + float specular_amnt = 1.f + [[ + anno::in_group("Specular Layer"), + anno::display_name("Specular color"), + anno::hard_range(0.f, 1.f) + ]], + float specular_glossiness = 0.6f + [[ + anno::in_group("Specular Layer"), + anno::display_name("Specular glossiness"), + anno::hard_range(0.f, 1.f) + ]], + + // Bump + float3 texmap_bump = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + float inv_radius = -100.f/(scatter_radius*scale); + float inv_div = 1.f/(1.f + math::max_value(scatter_color)); + color extinction = math::log(sub_surface_color*inv_div)*inv_radius; + color s = color(4.09712f) + 4.20863f*scatter_color - math::sqrt(9.59217f + 41.6808f*scatter_color + 17.7126f*scatter_color*scatter_color); + color ss_albedo = s*s; + + color absorption = extinction*ss_albedo; + color scattering = extinction - absorption; + + bsdf diffuse_sss_bsdf = df::weighted_layer + ( + weight : diffuse_amnt, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse_color + ), + base : df::diffuse_transmission_bsdf() + ); + + bsdf specular_bsdf = df::simple_glossy_bsdf + ( + mode : df::scatter_reflect, + tint : specular_color*specular_amnt, + roughness_u : 1.f - specular_glossiness + ); + + bsdf overall_bsdf = df::tint + ( + tint : overall_color, + base : df::fresnel_layer + ( + ior : ior, + layer : specular_bsdf, + base : diffuse_sss_bsdf + ) + + ); + +} +in material +( + ior : color(ior), + surface : material_surface + ( + scattering : overall_bsdf + ), + volume : material_volume + ( + scattering : df::anisotropic_vdf(phase_function), + absorption_coefficient : absorption, + scattering_coefficient : scattering + ), + geometry: material_geometry + ( + normal: texmap_bump + ) + +); diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/AM200_007_02.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/AM200_007_02.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d719bb90656c0f1aec9276f3b64d7c6b6220df12 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/AM200_007_02.mdl @@ -0,0 +1,212 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material AM200_007_02() +[[ + anno::display_name("AM200_007_02") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./AM200_007_02/AM200_007_02_Diffuse.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./AM200_007_02/AM200_007_02_Reflection.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + reflection_glossiness : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./AM200_007_02/AM200_007_02_Glossiness.jpg", ::tex::gamma_linear), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).mono, + reflection_fresnel : true, + reflection_ior : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./AM200_007_02/AM200_007_02_ior.jpg", ::tex::gamma_linear), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).mono, + reflection_lockIOR : false, + invert_reflection_ior : true, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ggx, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::vray_maps::VRayNormalMap_bump( + normal_map : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./AM200_007_02/AM200_007_02_Normal.jpg", ::tex::gamma_linear), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ), + normal_amount : 1.0f, + bump_amount : 1.0f, + flip_red : false, + flip_green : false, + swap_rg : false, + map_channel : 1, + map_rotation : 0.0f, + normal_map_amount : 1.0f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/AM200_007_03.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/AM200_007_03.mdl new file mode 100644 index 0000000000000000000000000000000000000000..55207d7b40bd869e0869a86b59323e511c535e96 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/AM200_007_03.mdl @@ -0,0 +1,212 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material AM200_007_03() +[[ + anno::display_name("AM200_007_03") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./AM200_007_03/AM200_007_03_Diffuse.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./AM200_007_03/AM200_007_03_Reflection.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + reflection_glossiness : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./AM200_007_03/AM200_007_03_Glossiness.jpg", ::tex::gamma_linear), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).mono, + reflection_fresnel : true, + reflection_ior : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./AM200_007_03/AM200_007_03_ior.jpg", ::tex::gamma_linear), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).mono, + reflection_lockIOR : false, + invert_reflection_ior : true, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ggx, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::vray_maps::VRayNormalMap_bump( + normal_map : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./AM200_007_03/AM200_007_03_Normal.jpg", ::tex::gamma_linear), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ), + normal_amount : 1.0f, + bump_amount : 1.0f, + flip_red : false, + flip_green : false, + swap_rg : false, + map_channel : 1, + map_rotation : 0.0f, + normal_map_amount : 1.0f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/CC.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/CC.mdl new file mode 100644 index 0000000000000000000000000000000000000000..597a35ad43a3380759e89d1e66c41d5db1c18cbe --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/CC.mdl @@ -0,0 +1,67 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::in_group; +import ::anno::key_words; +import ::anno::version; +import ::base::mono_mode; +import ::tex::gamma_mode; + +export material CC(*) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base", false), + anno::version(2, 1, 2, ""), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = OmniPBR::OmniPBR( + diffuse_color_constant: color(0.5f, 0.5f, 0.5f), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(0.f, 0.f, 0.f), + emissive_color_texture: texture_2d(), + emissive_mask_texture: texture_2d(), + emissive_intensity: 3250.f, + enable_opacity: false, + opacity_texture: texture_2d(), + opacity_constant: 1.f, + enable_opacity_texture: false, + opacity_mode: base::mono_average, + opacity_threshold: 0.00100000005f, + geometry_normal_roughness_strength: 1.f, + bump_factor: 0.300000012f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + flip_tangent_u: false, + flip_tangent_v: true, + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_517576_1_506.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_517576_1_506.mdl new file mode 100644 index 0000000000000000000000000000000000000000..80dcf8987f71a317208661af0aa85e1f7e0f85ee --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_517576_1_506.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_517576_1_506() +[[ + anno::display_name("Mat3d66_517576_1_506") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0,0.0509804,0.439216), + diffuse_roughness : 0.0f, + Reflection : color(0.0862745,0.0862745,0.0862745), + reflection_glossiness : 0.85f, + reflection_fresnel : true, + reflection_ior : 4.0f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_517576_2_224.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_517576_2_224.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a3038804068bd401eac6a01bf922990abf5cc2f4 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_517576_2_224.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_517576_2_224() +[[ + anno::display_name("Mat3d66_517576_2_224") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.152941,0.152941,0.152941), + diffuse_roughness : 0.0f, + Reflection : color(0.580392,0.580392,0.580392), + reflection_glossiness : 0.7f, + reflection_fresnel : true, + reflection_ior : 14.0f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_517576_3_412.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_517576_3_412.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c707b44c9914ef9064069ce6fea3b425546543f1 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_517576_3_412.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_517576_3_412() +[[ + anno::display_name("Mat3d66_517576_3_412") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0470588,0.0470588,0.0470588), + diffuse_roughness : 0.0f, + Reflection : color(0.0470588,0.0470588,0.0470588), + reflection_glossiness : 0.55f, + reflection_fresnel : true, + reflection_ior : 6.0f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_694158_10_3211.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_694158_10_3211.mdl new file mode 100644 index 0000000000000000000000000000000000000000..05042e722cf1a2895733cf067a9fa72a5cc051c0 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_694158_10_3211.mdl @@ -0,0 +1,137 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_694158_10_3211() +[[ + anno::display_name("Mat3d66_694158_10_3211") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Mat3d66_694158_10_3211/3d66Model-694158-files-2.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ), + color2 : base::texture_return(tint:color(0.862745,0.858824,0.85098), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Mat3d66_694158_10_3211/3d66Model-694158-files-2.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ), + color2 : base::texture_return(tint:color(0.352941,0.352941,0.352941), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint * 0.6 + color(0.392157,0.392157,0.392157) * 0.4, + reflection_glossiness : 0.74f, + reflection_fresnel : false, + reflection_ior : 6.0f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ward, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_694158_2_9145.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_694158_2_9145.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f41fa8920d5c5a2213ab09714ebc969af597fb19 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_694158_2_9145.mdl @@ -0,0 +1,85 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_694158_2_9145() +[[ + anno::display_name("Mat3d66_694158_2_9145") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.921569,0.917647,0.905882), mono:1), + color2 : base::texture_return(tint:color(0.862745,0.858824,0.85098), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.470588,0.470588,0.470588), mono:1), + color2 : base::texture_return(tint:color(0.352941,0.352941,0.352941), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.74f, + reflection_fresnel : true, + reflection_ior : 6.0f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ward, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_694158_9_6788.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_694158_9_6788.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f7219d73c6d6bbc65025c22565dfc6045a73782d --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_694158_9_6788.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_694158_9_6788() +[[ + anno::display_name("Mat3d66_694158_9_6788") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0,0.0196078,0.0), mono:1), + color2 : base::texture_return(tint:color(0.0,0.0431373,0.0), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : color(0.0862745,0.0862745,0.0862745), + reflection_glossiness : 0.68f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_17_1179.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_17_1179.mdl new file mode 100644 index 0000000000000000000000000000000000000000..382fa15eb0d23521b21d81a30aba5a749006c2a3 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_17_1179.mdl @@ -0,0 +1,67 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::in_group; +import ::anno::key_words; +import ::anno::version; +import ::base::mono_mode; +import ::tex::gamma_mode; + +export material Mat3d66_695886_17_1179(*) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base", false), + anno::version(2, 1, 2, ""), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = OmniPBR::OmniPBR( + diffuse_color_constant: color(0.5f, 0.5f, 0.5f), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(0.f, 0.f, 0.f), + emissive_color_texture: texture_2d(), + emissive_mask_texture: texture_2d(), + emissive_intensity: 3250.f, + enable_opacity: false, + opacity_texture: texture_2d(), + opacity_constant: 1.f, + enable_opacity_texture: false, + opacity_mode: base::mono_average, + opacity_threshold: 0.00100000005f, + geometry_normal_roughness_strength: 1.f, + bump_factor: 0.300000012f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + flip_tangent_u: false, + flip_tangent_v: true, + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_20_8749.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_20_8749.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d640166f32f86efce8090f442328603f4c7176a0 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_20_8749.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_20_8749() +[[ + anno::display_name("Mat3d66_695886_20_8749") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0980392,0.129412,0.156863), + diffuse_roughness : 0.0f, + Reflection : color(0.156863,0.156863,0.156863), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_21_4015.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_21_4015.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5b03e8a417651682ca91470e788cf56e8b949537 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_21_4015.mdl @@ -0,0 +1,129 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_21_4015() +[[ + anno::display_name("Mat3d66_695886_21_4015") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Mat3d66_695886_21_4015/3d66Model-695886-files-5.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mono_output : ::templates::ad_3dsmax_maps::mono_output_alpha, + rgb_output : ::templates::ad_3dsmax_maps::rgb_output_rgb, + alpha_source : ::templates::ad_3dsmax_maps::alpha_source_alpha, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Mat3d66_695886_21_4015/3d66Model-695886-files-5.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mono_output : ::templates::ad_3dsmax_maps::mono_output_alpha, + rgb_output : ::templates::ad_3dsmax_maps::rgb_output_rgb, + alpha_source : ::templates::ad_3dsmax_maps::alpha_source_alpha, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).mono +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_22_5064.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_22_5064.mdl new file mode 100644 index 0000000000000000000000000000000000000000..40a833fb03e90f158c2eddddbc02b9335c17a9bd --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_22_5064.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_22_5064() +[[ + anno::display_name("Mat3d66_695886_22_5064") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.701961,0.741176,0.784314), + diffuse_roughness : 0.0f, + Reflection : color(0.0784314,0.0784314,0.0784314), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_23_2454.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_23_2454.mdl new file mode 100644 index 0000000000000000000000000000000000000000..39dc936bc6be73512f5a027de10516227e50b106 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_23_2454.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_23_2454() +[[ + anno::display_name("Mat3d66_695886_23_2454") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.34902,0.368627,0.392157), + diffuse_roughness : 0.0f, + Reflection : color(0.235294,0.235294,0.235294), + reflection_glossiness : 0.9f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_25_4785.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_25_4785.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0e6aca2b2f912887355e930e5683f0a22ddba6e3 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_25_4785.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_25_4785() +[[ + anno::display_name("Mat3d66_695886_25_4785") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0156863,0.0156863,0.0196078), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0392157,0.0392157,0.0392157), mono:1), + color2 : base::texture_return(tint:color(0.509804,0.509804,0.509804), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.92f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_26_1030.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_26_1030.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ee000e2971cdf6ed447d4b2e5180e132ce4c59f4 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_26_1030.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_26_1030() +[[ + anno::display_name("Mat3d66_695886_26_1030") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0156863,0.0196078,0.0235294), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0392157,0.0392157,0.0392157), mono:1), + color2 : base::texture_return(tint:color(0.509804,0.509804,0.509804), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.92f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_30_6831.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_30_6831.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d53b79a81e115561ff057bdab91c7bb5c46bad58 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_30_6831.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_30_6831() +[[ + anno::display_name("Mat3d66_695886_30_6831") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0431373,0.0588235,0.0705882), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_34_7561.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_34_7561.mdl new file mode 100644 index 0000000000000000000000000000000000000000..76f38f5d94ba7a9c9a44a66aeca206c8eb62e40f --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_34_7561.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_34_7561() +[[ + anno::display_name("Mat3d66_695886_34_7561") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.996078,0.482353,0.0235294), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_35_8861.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_35_8861.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7480646e66f3a7e1c3f01e1eb8a1e231377e1304 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_35_8861.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_35_8861() +[[ + anno::display_name("Mat3d66_695886_35_8861") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0196078,0.0196078,0.0196078), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.92f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_38_3210.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_38_3210.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8b9a8cd7d26638e2a068e58b4f4fc0f43ed30944 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_38_3210.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_38_3210() +[[ + anno::display_name("Mat3d66_695886_38_3210") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.403922,0.411765,0.431373), + diffuse_roughness : 0.0f, + Reflection : color(0.117647,0.117647,0.117647), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.705882,0.705882,0.705882), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_39_4257.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_39_4257.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4ab57987048fbda0ce326004de99e5a8062c05a9 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_39_4257.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_39_4257() +[[ + anno::display_name("Mat3d66_695886_39_4257") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.882353,0.882353,0.831373), + diffuse_roughness : 0.0f, + Reflection : color(0.0784314,0.0784314,0.0784314), + reflection_glossiness : 0.9f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_40_8396.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_40_8396.mdl new file mode 100644 index 0000000000000000000000000000000000000000..154b519de237a378d0a7447986b983c40ee59029 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_40_8396.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_40_8396() +[[ + anno::display_name("Mat3d66_695886_40_8396") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0117647,0.0117647,0.0117647), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0392157,0.0392157,0.0392157), mono:1), + color2 : base::texture_return(tint:color(0.509804,0.509804,0.509804), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.92f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_41_2479.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_41_2479.mdl new file mode 100644 index 0000000000000000000000000000000000000000..810f5733d73414d32befc3c411b2e86e517f2ade --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_41_2479.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_41_2479() +[[ + anno::display_name("Mat3d66_695886_41_2479") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.113725,0.113725,0.117647), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0392157,0.0392157,0.0392157), mono:1), + color2 : base::texture_return(tint:color(0.509804,0.509804,0.509804), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.92f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_42_6200.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_42_6200.mdl new file mode 100644 index 0000000000000000000000000000000000000000..74d5d231ce5c16c36d3130b7619d3cfb6dcde630 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_42_6200.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_42_6200() +[[ + anno::display_name("Mat3d66_695886_42_6200") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.486275,0.0666667,0.0666667), + diffuse_roughness : 0.0f, + Reflection : color(0.235294,0.235294,0.235294), + reflection_glossiness : 0.8f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_43_7426.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_43_7426.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fc1c61edeefac0334892e5f9992efb48142e0e46 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_43_7426.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_43_7426() +[[ + anno::display_name("Mat3d66_695886_43_7426") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.996078,0.596078,0.0235294), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_44_7752.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_44_7752.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0d072f8737a4275a4fbe410be271c0bf69e921cb --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_44_7752.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_44_7752() +[[ + anno::display_name("Mat3d66_695886_44_7752") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.996078,0.0235294,0.0235294), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_45_6577.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_45_6577.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ef9b930b7b916938b264b465ed5438fe436680bb --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_45_6577.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_45_6577() +[[ + anno::display_name("Mat3d66_695886_45_6577") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0901961,0.996078,0.0235294), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_47_3117.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_47_3117.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4060b3789febf992ae08b8014e4b97a62a71d141 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_47_3117.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_47_3117() +[[ + anno::display_name("Mat3d66_695886_47_3117") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.768628,0.776471,0.784314), + diffuse_roughness : 0.0f, + Reflection : color(0.0784314,0.0784314,0.0784314), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_49_1180.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_49_1180.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a6303533b9c210799b51404635c3b96f8bcd4b99 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_49_1180.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_49_1180() +[[ + anno::display_name("Mat3d66_695886_49_1180") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0117647,0.466667,0.258824), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_50_2873.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_50_2873.mdl new file mode 100644 index 0000000000000000000000000000000000000000..031753917f952d6459a24fe321cbf0c3013df3e1 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_50_2873.mdl @@ -0,0 +1,96 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_50_2873() +[[ + anno::display_name("Mat3d66_695886_50_2873") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.380392,0.380392,0.380392), + diffuse_roughness : 0.0f, + Reflection : color(0.0588235,0.0588235,0.0588235), + reflection_glossiness : 0.88f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_noise_bump( + color1 : color(0.0,0.0,0.0), + color2 : color(1.0,1.0,1.0), + size : 8.0f, + phase : 0.0f, + levels : 3.0f, + thresholdLow : 0.0f, + thresholdHigh : 1.0f, + type : 0, + blur : 1.0f, + offset : float3(0.0f,0.0f,0.0f), + tiling : float3(1.0f,1.0f,1.0f), + angle : float3(0.0f,0.0f,0.0f), + blur_Offset : 0.0f, + coordType : 0, + mapChannel : 1, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.3f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_52_5706.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_52_5706.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ba85020eb322c55344dde5ab15f89252a8e79ea9 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_52_5706.mdl @@ -0,0 +1,99 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_52_5706() +[[ + anno::display_name("Mat3d66_695886_52_5706") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0196078,0.0196078,0.0196078), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap_bump( + filename : texture_2d("./Mat3d66_695886_52_5706/3d66Model-695886-files-2.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 30.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 30.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.5f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_54_8323.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_54_8323.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7795324235c64bb80d93d025a6e48b4843c3f65b --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_54_8323.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_54_8323() +[[ + anno::display_name("Mat3d66_695886_54_8323") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.780392,0.101961,0.0117647), + diffuse_roughness : 0.0f, + Reflection : color(0.117647,0.117647,0.117647), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.2,0.2,0.2), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_55_1062.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_55_1062.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c2c1f2adba1c0ea389f1d3ec3435de5da1339103 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_55_1062.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_55_1062() +[[ + anno::display_name("Mat3d66_695886_55_1062") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0470588,0.0470588,0.0470588), + diffuse_roughness : 0.0f, + Reflection : color(0.117647,0.117647,0.117647), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_57_1075.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_57_1075.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fb6d91fb6cd1392b49096716d5bdbb412b0250a4 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_57_1075.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_57_1075() +[[ + anno::display_name("Mat3d66_695886_57_1075") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0196078,0.0196078,0.0196078), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.9f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_59_8080.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_59_8080.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7f209f44c7c9adcd4271cb7c839b3340360116dd --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_59_8080.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_59_8080() +[[ + anno::display_name("Mat3d66_695886_59_8080") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.996078,0.27451,0.0235294), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_61_4109.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_61_4109.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6f5a9de0b9443cab31e6edaaa6eccbe87c65eb06 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_61_4109.mdl @@ -0,0 +1,96 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_61_4109() +[[ + anno::display_name("Mat3d66_695886_61_4109") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0,0.133333,0.435294), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_noise_bump( + color1 : color(0.0,0.0,0.0), + color2 : color(1.0,1.0,1.0), + size : 8.0f, + phase : 0.0f, + levels : 3.0f, + thresholdLow : 0.0f, + thresholdHigh : 1.0f, + type : 0, + blur : 1.0f, + offset : float3(0.0f,0.0f,0.0f), + tiling : float3(1.0f,1.0f,1.0f), + angle : float3(0.0f,0.0f,0.0f), + blur_Offset : 0.0f, + coordType : 0, + mapChannel : 1, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.3f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_62_517.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_62_517.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7558ffe801291061da946aa9cc268622134d8b39 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_62_517.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_62_517() +[[ + anno::display_name("Mat3d66_695886_62_517") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0117647,0.0117647,0.0117647), + diffuse_roughness : 0.0f, + Reflection : color(0.0784314,0.0784314,0.0784314), + reflection_glossiness : 0.7f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_64_286.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_64_286.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e78013c90faca1893b2a516d946b0ea230ed8df5 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_64_286.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_64_286() +[[ + anno::display_name("Mat3d66_695886_64_286") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.403922,0.411765,0.431373), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.980392,0.980392,0.980392), + refraction_glossiness : 1.0f, + refraction_ior : 1.0f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_65_3845.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_65_3845.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f57667ad1160c40e84f3d5fbe22cd1cca5cdad34 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_65_3845.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_65_3845() +[[ + anno::display_name("Mat3d66_695886_65_3845") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.901961,0.901961,0.882353), + diffuse_roughness : 0.0f, + Reflection : color(0.0784314,0.0784314,0.0784314), + reflection_glossiness : 0.9f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_66_7053.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_66_7053.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4286830c61f91d646488b0c57e1ca059e114a509 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_66_7053.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_66_7053() +[[ + anno::display_name("Mat3d66_695886_66_7053") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.164706,0.0705882,0.0), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0392157,0.0392157,0.0392157), mono:1), + color2 : base::texture_return(tint:color(0.415686,0.219608,0.0745098), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.92f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_79_4062.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_79_4062.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b5c2751e5332cdab9cc926971589b381e23972a7 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_79_4062.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_79_4062() +[[ + anno::display_name("Mat3d66_695886_79_4062") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.027451,0.0196078,0.215686), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_83_6379.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_83_6379.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fdc24f12b7cc6da4879cd65e53e9f991b05a3cf0 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_83_6379.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_83_6379() +[[ + anno::display_name("Mat3d66_695886_83_6379") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.054902,0.054902,0.054902), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0392157,0.0392157,0.0392157), mono:1), + color2 : base::texture_return(tint:color(0.509804,0.509804,0.509804), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.92f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_86_885.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_86_885.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4d272d8fd852bc5a3e8f65279f87c7aad39038a2 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_86_885.mdl @@ -0,0 +1,96 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_86_885() +[[ + anno::display_name("Mat3d66_695886_86_885") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0196078,0.0196078,0.0196078), + diffuse_roughness : 0.0f, + Reflection : color(0.0588235,0.0588235,0.0588235), + reflection_glossiness : 0.88f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_noise_bump( + color1 : color(0.0,0.0,0.0), + color2 : color(1.0,1.0,1.0), + size : 8.0f, + phase : 0.0f, + levels : 3.0f, + thresholdLow : 0.0f, + thresholdHigh : 1.0f, + type : 0, + blur : 1.0f, + offset : float3(0.0f,0.0f,0.0f), + tiling : float3(1.0f,1.0f,1.0f), + angle : float3(0.0f,0.0f,0.0f), + blur_Offset : 0.0f, + coordType : 0, + mapChannel : 1, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.3f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_87_3246.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_87_3246.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d259c86b49547fc56443d97caf2006defd80bf5e --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_87_3246.mdl @@ -0,0 +1,91 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_87_3246() +[[ + anno::display_name("Mat3d66_695886_87_3246") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::vray_maps::VRayColor( + color_mode : ::templates::vray_maps::mode_color, + temperature : 6500.0f, + red : 0.054902f, + green : 0.054902f, + blue : 0.0509804f, + rgb_multiplier : 1.0f, + alpha : 1.0f, + color_gamma : 1.0f, + rgb_primaries : ::templates::vray_maps::primaries_none + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::vray_maps::VRayColor( + color_mode : ::templates::vray_maps::mode_color, + temperature : 6500.0f, + red : 0.509804f, + green : 0.509804f, + blue : 0.505882f, + rgb_multiplier : 1.0f, + alpha : 1.0f, + color_gamma : 1.0f, + rgb_primaries : ::templates::vray_maps::primaries_none + ).tint, + reflection_glossiness : 0.82f, + reflection_fresnel : true, + reflection_ior : 20.0f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_phong, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_88_5700.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_88_5700.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9b52b136c451359a4ff8caf2f5066a10c1d22efe --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_88_5700.mdl @@ -0,0 +1,125 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_88_5700() +[[ + anno::display_name("Mat3d66_695886_88_5700") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Mat3d66_695886_88_5700/3d66Model-695886-files-4.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap_bump( + filename : texture_2d("./Mat3d66_695886_88_5700/3d66Model-695886-files-4.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.3f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_89_2578.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_89_2578.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d2ca7289ba303cfad629e42bfc86046cbbd8f999 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_89_2578.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_89_2578() +[[ + anno::display_name("Mat3d66_695886_89_2578") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0,0.305882,0.215686), + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_90_5554.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_90_5554.mdl new file mode 100644 index 0000000000000000000000000000000000000000..be10ba0bff3c3f4bcee16c7385394fdc9085c1f0 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_90_5554.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_90_5554() +[[ + anno::display_name("Mat3d66_695886_90_5554") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.403922,0.411765,0.431373), + diffuse_roughness : 0.0f, + Reflection : color(0.172549,0.172549,0.172549), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.588235,0.588235,0.588235), + refraction_glossiness : 0.6f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_91_7809.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_91_7809.mdl new file mode 100644 index 0000000000000000000000000000000000000000..63754b246a6c241f5c3b273d6eeedff1bc145656 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_91_7809.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_91_7809() +[[ + anno::display_name("Mat3d66_695886_91_7809") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0156863,0.0156863,0.0156863), + diffuse_roughness : 0.0f, + Reflection : color(0.313726,0.313726,0.313726), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_92_6668.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_92_6668.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5fc14e2e3b1006d93519ff4fc8b903664db8d284 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_92_6668.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_92_6668() +[[ + anno::display_name("Mat3d66_695886_92_6668") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.290196,0.290196,0.27451), + diffuse_roughness : 0.0f, + Reflection : color(0.0784314,0.0784314,0.0784314), + reflection_glossiness : 0.9f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_95_7587.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_95_7587.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d655a1537aefc65249d0f2ce77b1aa1bfa089de5 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Mat3d66_695886_95_7587.mdl @@ -0,0 +1,125 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_695886_95_7587() +[[ + anno::display_name("Mat3d66_695886_95_7587") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Mat3d66_695886_95_7587/3d66Model-695886-files-1.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap_bump( + filename : texture_2d("./Mat3d66_695886_95_7587/3d66Model-695886-files-1.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.3f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__28.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__28.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ff1bad1eae6894a06af63ce10e5272f769c7736e --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__28.mdl @@ -0,0 +1,181 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__28() +[[ + anno::display_name("Material__28") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::vray_maps::VRayDirt( + radius : 50.0f, + occluded_color : color(0.0,0.0,0.0), + unoccluded_color : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__28/Maple_honey.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__28/Maple_honey1_凹凸.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint * 0.7 + color(0.27451,0.27451,0.27451) * 0.3, + reflection_glossiness : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__28/Maple_honey1_凹凸.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).mono * 0.2 + 0.9f * 0.8, + reflection_fresnel : true, + reflection_ior : 3.5f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap_bump( + filename : texture_2d("./Material__28/Maple_honey1_凹凸.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.05f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__522.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__522.mdl new file mode 100644 index 0000000000000000000000000000000000000000..31043b7b53147d4d001ab7645895b70a1ea61380 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__522.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__522() +[[ + anno::display_name("Material__522") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.113725,0.113725,0.113725), + diffuse_roughness : 0.0f, + Reflection : color(0.196078,0.196078,0.196078), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__524.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__524.mdl new file mode 100644 index 0000000000000000000000000000000000000000..aa7436a65a61318e7d8be39ecd54f49d3eb4252a --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__524.mdl @@ -0,0 +1,181 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__524() +[[ + anno::display_name("Material__524") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::vray_maps::VRayDirt( + radius : 50.0f, + occluded_color : color(0.0,0.0,0.0), + unoccluded_color : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__524/Maple_honey.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__524/Maple_honey1_凹凸.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint * 0.7 + color(0.27451,0.27451,0.27451) * 0.3, + reflection_glossiness : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__524/Maple_honey1_凹凸.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).mono * 0.2 + 0.9f * 0.8, + reflection_fresnel : true, + reflection_ior : 3.5f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap_bump( + filename : texture_2d("./Material__524/Maple_honey1_凹凸.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.05f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__525.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__525.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8e96c799a06b06afde406217ebd4d7e8410f84df --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__525.mdl @@ -0,0 +1,219 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__525() +[[ + anno::display_name("Material__525") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_output( + MAP1 : ::templates::ad_3dsmax_maps::ad_3dsmax_composite( + blendMode1 : 0, + map1 : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__525/velvet_dirt 02.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 2.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 2.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ), + opacity1 : 100.0f, + blendMode2 : 5, + map2 : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__525/3557.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 0.6f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : true, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ), + opacity2 : 99.0f + ), + bump_amount : 1.0f, + clamp : false, + invert : false, + alphaFromRGB : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__525/velvet_dirt 02.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 2.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 2.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint * 0.2 + color(0.196078,0.196078,0.196078) * 0.8, + reflection_glossiness : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__525/velvet_dirt 02.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 2.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 2.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).mono * 0.5 + 0.7f * 0.5, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ward, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap_bump( + filename : texture_2d("./Material__525/velvet_dirt 02.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 2.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 2.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.03f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__526.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__526.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ce6572e8677a320cb84dbe7c41208ce8b63fadd4 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Material__526.mdl @@ -0,0 +1,277 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__526() +[[ + anno::display_name("Material__526") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_color_correction( + hue_shift : -2.0f, + map : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__526/Maple_honey.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ), + rewireA : ::templates::ad_3dsmax_maps::channel_alpha, + rewireB : ::templates::ad_3dsmax_maps::channel_blue, + rewireG : ::templates::ad_3dsmax_maps::channel_green, + rewireR : ::templates::ad_3dsmax_maps::channel_red, + saturation : -41.5282f, + hue_tint : 0.0f, + hue_tint_amnt : 0.0f, + lightness_mode : ::templates::ad_3dsmax_maps::Advanced, + brightness : 0.0f, + contrast : 0.0f, + rgb_gamma : 0.6f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_color_correction( + hue_shift : 0.0f, + map : ::templates::ad_3dsmax_maps::ad_3dsmax_color_correction( + hue_shift : -2.0f, + map : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__526/Maple_honey.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ), + rewireA : ::templates::ad_3dsmax_maps::channel_alpha, + rewireB : ::templates::ad_3dsmax_maps::channel_blue, + rewireG : ::templates::ad_3dsmax_maps::channel_green, + rewireR : ::templates::ad_3dsmax_maps::channel_red, + saturation : -41.5282f, + hue_tint : 0.0f, + hue_tint_amnt : 0.0f, + lightness_mode : ::templates::ad_3dsmax_maps::Advanced, + brightness : 0.0f, + contrast : 0.0f, + rgb_gamma : 0.6f + ), + rewireA : ::templates::ad_3dsmax_maps::channel_alpha, + rewireB : ::templates::ad_3dsmax_maps::channel_blue, + rewireG : ::templates::ad_3dsmax_maps::channel_green, + rewireR : ::templates::ad_3dsmax_maps::channel_red, + saturation : -100.0f, + hue_tint : 0.0f, + hue_tint_amnt : 0.0f, + lightness_mode : ::templates::ad_3dsmax_maps::Standard, + brightness : 0.0f, + contrast : 0.0f, + rgb_gamma : 1.0f + ).tint * 0.5 + color(0.196078,0.196078,0.196078) * 0.5, + reflection_glossiness : ::templates::ad_3dsmax_maps::ad_3dsmax_color_correction( + hue_shift : 0.0f, + map : ::templates::ad_3dsmax_maps::ad_3dsmax_color_correction( + hue_shift : -2.0f, + map : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Material__526/Maple_honey.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ), + rewireA : ::templates::ad_3dsmax_maps::channel_alpha, + rewireB : ::templates::ad_3dsmax_maps::channel_blue, + rewireG : ::templates::ad_3dsmax_maps::channel_green, + rewireR : ::templates::ad_3dsmax_maps::channel_red, + saturation : -41.5282f, + hue_tint : 0.0f, + hue_tint_amnt : 0.0f, + lightness_mode : ::templates::ad_3dsmax_maps::Advanced, + brightness : 0.0f, + contrast : 0.0f, + rgb_gamma : 0.6f + ), + rewireA : ::templates::ad_3dsmax_maps::channel_alpha, + rewireB : ::templates::ad_3dsmax_maps::channel_blue, + rewireG : ::templates::ad_3dsmax_maps::channel_green, + rewireR : ::templates::ad_3dsmax_maps::channel_red, + saturation : -100.0f, + hue_tint : 0.0f, + hue_tint_amnt : 0.0f, + lightness_mode : ::templates::ad_3dsmax_maps::Standard, + brightness : 0.0f, + contrast : 0.0f, + rgb_gamma : 1.0f + ).mono * 0.1 + 0.8f * 0.9, + reflection_fresnel : true, + reflection_ior : 3.5f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ggx, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_color_correction_bump( + hue_shift : 0.0f, + map : ::templates::ad_3dsmax_maps::ad_3dsmax_color_correction_bump( + hue_shift : -2.0f, + map : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap_bump( + filename : texture_2d("./Material__526/Maple_honey.png", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 1.0f + ), + rewireA : ::templates::ad_3dsmax_maps::channel_alpha, + rewireB : ::templates::ad_3dsmax_maps::channel_blue, + rewireG : ::templates::ad_3dsmax_maps::channel_green, + rewireR : ::templates::ad_3dsmax_maps::channel_red, + saturation : -41.5282f, + hue_tint : 0.0f, + hue_tint_amnt : 0.0f, + lightness_mode : ::templates::ad_3dsmax_maps::Advanced, + brightness : 0.0f, + contrast : 0.0f, + rgb_gamma : 0.6f, + bump_amount : 1.0f + ), + rewireA : ::templates::ad_3dsmax_maps::channel_alpha, + rewireB : ::templates::ad_3dsmax_maps::channel_blue, + rewireG : ::templates::ad_3dsmax_maps::channel_green, + rewireR : ::templates::ad_3dsmax_maps::channel_red, + saturation : -100.0f, + hue_tint : 0.0f, + hue_tint_amnt : 0.0f, + lightness_mode : ::templates::ad_3dsmax_maps::Standard, + brightness : 0.0f, + contrast : 0.0f, + rgb_gamma : 1.0f, + bump_amount : 0.05f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Metal_Silver_1.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Metal_Silver_1.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3667ed758459d7a415d91e2942e2442781c550fa --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Metal_Silver_1.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Metal_Silver_1() +[[ + anno::display_name("Metal_Silver_1") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.823529,0.823529,0.823529), + diffuse_roughness : 0.0f, + Reflection : color(0.380392,0.380392,0.380392), + reflection_glossiness : 0.9f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Standard_7.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Standard_7.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2f6fe8ca6d496c7fb67f94a0dec1f60390b0d250 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/Standard_7.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Standard_7() +[[ + anno::display_name("Standard_7") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.321569,0.321569,0.321569), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a12___Default.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a12___Default.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d31f33047d635adb0f11b6df9c8ee1a3188a64ce --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a12___Default.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a12___Default() +[[ + anno::display_name("_12___Default") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.603922,0.603922,0.603922), + diffuse_roughness : 0.0f, + Reflection : color(0.396078,0.396078,0.396078), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a13___Default.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a13___Default.mdl new file mode 100644 index 0000000000000000000000000000000000000000..ed946d356ad24e025a92361f3b3266b843f3f93b --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a13___Default.mdl @@ -0,0 +1,40 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a13___Default() +[[ + anno::display_name("_13___Default") +]] += ::templates::vray_materials::VRayLightMtl( + emission : color(1.0,1.0,1.0), + emission_mult : 1500.0f, + opacity : color(1.0,1.0,1.0), + emit_on_backside : false, + mult_emission_by_opacity : false, + displacement : 0.0f, + displace_amnt : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a20___Defau324lt2aa33a.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a20___Defau324lt2aa33a.mdl new file mode 100644 index 0000000000000000000000000000000000000000..71a89290cf8238ecca9335e5ffc0d0f3c152dae1 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a20___Defau324lt2aa33a.mdl @@ -0,0 +1,96 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a20___Defau324lt2aa33a() +[[ + anno::display_name("_20___Defau324lt2aa33a") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.784314,0.964706,0.294118), + diffuse_roughness : 0.0f, + Reflection : color(0.458824,0.458824,0.458824) * 0.2 + color(0.458824,0.458824,0.458824) * 0.8, + reflection_glossiness : 0.85f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_noise_bump( + color1 : color(0.0,0.0,0.0), + color2 : color(1.0,1.0,1.0), + size : 250.0f, + phase : 0.0f, + levels : 3.0f, + thresholdLow : 0.0f, + thresholdHigh : 1.0f, + type : 0, + blur : 1.0f, + offset : float3(0.0f,0.0f,0.0f), + tiling : float3(1.0f,1.0f,1.0f), + angle : float3(0.0f,0.0f,0.0f), + blur_Offset : 0.0f, + coordType : 0, + mapChannel : 1, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.04f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a20___Default2aa33a.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a20___Default2aa33a.mdl new file mode 100644 index 0000000000000000000000000000000000000000..6cbed8aa5ede53cf9c75d9f6a4d6c525f4769f1b --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a20___Default2aa33a.mdl @@ -0,0 +1,96 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a20___Default2aa33a() +[[ + anno::display_name("_20___Default2aa33a") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.368627,0.388235,0.4), + diffuse_roughness : 0.0f, + Reflection : color(0.458824,0.458824,0.458824) * 0.2 + color(0.458824,0.458824,0.458824) * 0.8, + reflection_glossiness : 0.85f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_noise_bump( + color1 : color(0.0,0.0,0.0), + color2 : color(1.0,1.0,1.0), + size : 250.0f, + phase : 0.0f, + levels : 3.0f, + thresholdLow : 0.0f, + thresholdHigh : 1.0f, + type : 0, + blur : 1.0f, + offset : float3(0.0f,0.0f,0.0f), + tiling : float3(1.0f,1.0f,1.0f), + angle : float3(0.0f,0.0f,0.0f), + blur_Offset : 0.0f, + coordType : 0, + mapChannel : 1, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.04f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a24___Default.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a24___Default.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e1e23fcc3270c09aaa99e9dc0a1138c8f36d1a56 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a24___Default.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a24___Default() +[[ + anno::display_name("_24___Default") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.94902,0.94902,0.94902), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ggx, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a24___Default2.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a24___Default2.mdl new file mode 100644 index 0000000000000000000000000000000000000000..4bad1891beadefc46bca92f67bda2e3f004e9f81 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a24___Default2.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a24___Default2() +[[ + anno::display_name("_24___Default2") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.223529,0.223529,0.223529), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a24___Default3.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a24___Default3.mdl new file mode 100644 index 0000000000000000000000000000000000000000..fdd20d7df11e37844ebd643ba234c1176b564794 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a24___Default3.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a24___Default3() +[[ + anno::display_name("_24___Default3") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.235294,0.235294,0.235294), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ggx, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a_____.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a_____.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e0a6e1a45ae33ab3d52777b378abe581ebd9ddfb --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/a_____.mdl @@ -0,0 +1,67 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::in_group; +import ::anno::key_words; +import ::anno::version; +import ::base::mono_mode; +import ::tex::gamma_mode; + +export material a_____(*) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base", false), + anno::version(2, 1, 2, ""), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = OmniPBR::OmniPBR( + diffuse_color_constant: color(0.5f, 0.5f, 0.5f), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(0.f, 0.f, 0.f), + emissive_color_texture: texture_2d(), + emissive_mask_texture: texture_2d(), + emissive_intensity: 3250.f, + enable_opacity: false, + opacity_texture: texture_2d(), + opacity_constant: 1.f, + enable_opacity_texture: false, + opacity_mode: base::mono_average, + opacity_threshold: 0.00100000005f, + geometry_normal_roughness_strength: 1.f, + bump_factor: 0.300000012f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + flip_tangent_u: false, + flip_tangent_v: true, + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/metal.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/metal.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e1f4c84ad793b4737333d788ac20a504e796ef18 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/metal.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material metal() +[[ + anno::display_name("metal") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.639216,0.647059,0.658824) * 0.2 + color(0.639216,0.647059,0.658824) * 0.8, + diffuse_roughness : 0.0f, + Reflection : color(0.341176,0.341176,0.341176), + reflection_glossiness : 0.75f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(0.898039,0.905882,0.952941), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_phong, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/pipes.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/pipes.mdl new file mode 100644 index 0000000000000000000000000000000000000000..60bc4daf07b046181d1317b5244d1dc6f6e0aa29 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/pipes.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material pipes() +[[ + anno::display_name("pipes") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.27451,0.27451,0.27451), + diffuse_roughness : 0.0f, + Reflection : color(0.341176,0.341176,0.341176), + reflection_glossiness : 0.8f, + reflection_fresnel : false, + reflection_ior : 2.0f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/sfwdv.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/sfwdv.mdl new file mode 100644 index 0000000000000000000000000000000000000000..14ca295d0d8e2360dc11d435e6fe1fa980620e70 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/sfwdv.mdl @@ -0,0 +1,125 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material sfwdv() +[[ + anno::display_name("sfwdv") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./sfwdv/3d66Model-695886-files-4.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : color(0.372549,0.372549,0.372549), + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap_bump( + filename : texture_2d("./sfwdv/3d66Model-695886-files-4.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.3f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/ad_3dsmax_maps.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/ad_3dsmax_maps.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2335faa6461beac39ae2c5235c9285b2b0cb8596 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/ad_3dsmax_maps.mdl @@ -0,0 +1,4128 @@ +// Copyright 2023 NVIDIA Corporation. All rights reserved. +// +// NVIDIA CORPORATION and its licensors retain all intellectual property +// and proprietary rights in and to this software, related documentation +// and any modifications thereto. Any use, reproduction, disclosure or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA CORPORATION is strictly prohibited. + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::limits::*; +import ::math::*; +import ::state::*; +import ::tex::*; + +export using ::base import color_layer_mode; +export using ::base import texture_return; + +// Helper functions +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +{ + 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) +{ + return state::texture_tangent_u(0) * n.x + + state::texture_tangent_v(0) * n.y + + state::normal() * n.z ; +} + +// Returns a normal as a weighted combination of two normals. +export float3 combine_normals( + float w1 = 1.f, float3 n1 = state::normal(), + float w2 = 1.f, float3 n2 = state::normal()) +{ + // http://blog.selfshadow.com/publications/blending-in-detail/ + float3 n1_t = transform_internal_to_tangent(n1); + float3 n2_t = transform_internal_to_tangent(n2); + + n1_t = math::lerp(float3(0.f, 0.f, 1.f), n1_t, w1); + n2_t = math::lerp(float3(0.f, 0.f, 1.f), n2_t, w2); + + n1_t = n1_t + float3(0.f, 0.f, 1.f); + n2_t = n2_t * float3(-1.f, -1.f, 1.f); + + float3 n = n1_t*math::dot(n1_t, n2_t)/n1_t.z - n2_t; + + // alternative way of combining the 2 normals + // float3 n = float3(n1_t.x + n2_t.x,n1_t.y + n2_t.y, n1_t.z*n2_t.z); + + return math::normalize(transform_tangent_to_internal(n)); +} + +// 3dsmax Bitmap Transformation Matrix +uniform float4x4 max_rotation_translation_scale +( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]], + uniform bool u_mirror = false + [[ anno::description("Mirror repeat has twice the number of textures in the same space") ]], + uniform bool v_mirror = false + [[ anno::description("Mirror repeat has twice the number of textures in the same space") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale") +]] +{ + float4x4 scale = + float4x4(u_mirror?scaling.x*2.:scaling.x , 0. , 0. , 0., + 0. , v_mirror?scaling.y*2.:scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + u_mirror?1.:.5 , v_mirror?1.:.5 , .5 , 1.); + + float4x4 translate = + float4x4(1. , 0. , 0. , 0., + 0. , 1. , 0. , 0., + 0. , 0. , 1. , 0., + -0.5-translation.x, -0.5-translation.y, -0.5-translation.z, 1.); + + + // Euler rotation matrix xyz order + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , c.y*s.z , -s.y , 0.0, + -c.x*s.z + s.x*s.y*c.z, c.x*c.z + s.x*s.y*s.z , s.x*c.y , 0.0, + s.x*s.z + c.x*s.y*c.z , -s.x*c.z + c.x*s.y*s.z, c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + return scale *rotate*translate; +} + +// 3dsmax Mono Output +export enum ad_3dsmax_mono_output +[[ + anno::hidden() +]] +{ + mono_output_rgb_intensity, + mono_output_alpha +}; + +// 3dsmax RGB Output +export enum ad_3dsmax_rgb_output +[[ + anno::hidden() +]] +{ + rgb_output_rgb, + rgb_output_alpha +}; + +// 3dsmax Alpha Source +export enum ad_3dsmax_alpha_source +[[ + anno::hidden() +]] +{ + alpha_source_alpha, + alpha_source_rgb_intensity, + alpha_source_none +}; + +// 3dsmax Bitmap map +export texture_return ad_3dsmax_bitmap +( + uniform int mapChannel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform bool U_Tile=true //it is actually an error if both mirror and tile are true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile") + ]], + uniform bool U_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile") + ]], + uniform bool V_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle") + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused(), + anno::hidden() + ]], + uniform texture_2d filename = texture_2d() + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bitmap") + ]], + uniform float clipu = 0.f //u+w and v+h are always <=1.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("U Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipw = 1.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("W Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipv = 0.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("V Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float cliph = 1.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("H Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform ad_3dsmax_mono_output mono_output = mono_output_rgb_intensity + [[ + anno::in_group("Mono Output"), + anno::display_name("Mono Output") + ]], + uniform ad_3dsmax_rgb_output rgb_output = rgb_output_rgb + [[ + anno::in_group("RGB Output"), + anno::display_name("RGB Output") + ]], + uniform ad_3dsmax_alpha_source alpha_source = alpha_source_none + [[ + anno::in_group("Alpha Source"), + anno::display_name("Alpha Source") + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output amount") + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB level") + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + texture_return result = base::file_texture + ( + texture: filename, + mono_source: (alpha_source == alpha_source_alpha) ? base::mono_alpha : base::mono_average, + crop_u: float2(clipu, clipw+clipu), + crop_v: float2(1.-clipv-cliph, 1.-clipv), + uvw: base::transform_coordinate( + transform: max_rotation_translation_scale( + scaling: float3(U_Tiling,V_Tiling,1.0), + rotation: float3(U_angle,V_angle,W_angle)/180.*math::PI, + translation: float3(U_Offset,V_Offset,0.0),u_mirror: U_Mirror,v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: mapChannel-1) + ), + wrap_u: U_Tile?tex::wrap_repeat:U_Mirror?tex::wrap_mirrored_repeat:tex::wrap_clip, + wrap_v: V_Tile?tex::wrap_repeat:V_Mirror?tex::wrap_mirrored_repeat:tex::wrap_clip + ); + + result.tint = invert ? result.tint * (-rgb_level * output_amount ) + (1.f - rgb_offset) : result.tint * (rgb_level * output_amount ) + rgb_offset; + + float alpha = (alpha_source != alpha_source_none) ? result.mono : 1.f; + result.tint = result.tint*alpha; + + // determinate mono output + if(mono_output == mono_output_alpha) + result.mono = alpha; + else + result.mono = math::average(result.tint); + + // determinate rgb output + if(rgb_output == rgb_output_alpha) + result.tint = color(alpha); + + return result; +} +// 3dsmax Bitmap Map for Bump +export float3 ad_3dsmax_bitmap_bump +( + uniform int mapChannel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform bool U_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile") + ]], + uniform bool U_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile") + ]], + uniform bool V_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1. + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused() + ]], + uniform texture_2d filename = texture_2d() + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bitmap") + ]], + uniform float clipu = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("U Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipw = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("W Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipv = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("V Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float cliph = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("H Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float factor = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bump amount") + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump output") + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB intensity"), + anno::unused() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output amount"), + anno::unused() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB level"), + anno::unused() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return base::file_bump_texture + ( + texture : filename, + crop_u : float2(clipu, clipw + clipu), + crop_v : float2(1.f - clipv - cliph, 1.f - clipv), + uvw : base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling : float3(U_Tiling, V_Tiling, 1.f), + rotation : float3(U_angle, V_angle, W_angle)/(180.f*math::PI), + translation : float3(U_Offset, V_Offset, 0.f), + u_mirror : U_Mirror, + v_mirror : V_Mirror + ), + coordinate: base::coordinate_source(texture_space: mapChannel - 1) + ), + wrap_u : U_Tile ? tex::wrap_repeat : U_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + wrap_v : V_Tile ? tex::wrap_repeat : V_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + factor : invert ? -10.f*factor*bump_amount : 10.f*factor*bump_amount + ); +} + +// 3dsmax Bitmap Normal Map +export float3 ad_3dsmax_bitmap_normalmap +( + uniform int mapChannel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform bool U_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile") + ]], + uniform bool U_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile") + ]], + uniform bool V_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW type"), + anno::unused() + ]], + uniform texture_2d filename = texture_2d() + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bitmap") + ]], + uniform float clipu = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("U Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipw = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("W Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float clipv = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("V Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float cliph = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("H Clip"), + anno::hard_range(0.f, 1.f) + ]], + uniform float factor = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Strength") + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump Amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output Amount") + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB level") + ]], + uniform float rgb_offset = 0.0 + [[ + anno::in_group("Output"), + anno::display_name("RGB offset"), + anno::unused(), + anno::hidden() + ]], + uniform float mult_spin = 1.f + [[ + anno::in_group("Parameters"), + anno::display_name("Normal map mult") + ]], + uniform bool swap_rg = false + [[ + anno::in_group("Parameters"), + anno::display_name("Swap red & green"), + anno::unused(), + anno::hidden() + ]], + uniform bool flipred = false + [[ + anno::in_group("Parameters"), + anno::display_name("Flip red") + ]], + uniform bool flipgreen = false + [[ + anno::in_group("Parameters"), + anno::display_name("Flip green") + ]], + + uniform int method = 0 + [[ + anno::in_group("Parameters"), + anno::display_name("Method"), + anno::unused(), + anno::hidden() + ]], + float3 bump_map = state::normal() + [[ + anno::in_group("Parameters"), + anno::display_name("Bump map"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return base::tangent_space_normal_texture( + texture: filename, + crop_u: float2(clipu, clipw + clipu), + crop_v: float2(1.f - clipv - cliph, 1.f - clipv), + factor: factor*mult_spin*rgb_level*output_amount, + flip_tangent_u: invert ? !flipred : flipred, + flip_tangent_v: invert ? flipgreen : !flipgreen, + uvw: base::transform_coordinate( + transform: max_rotation_translation_scale( + scaling: float3(U_Tiling, V_Tiling, 1.f), + rotation: float3(U_angle, V_angle, W_angle)/180.f*math::PI , + translation: float3(U_Offset, V_Offset, 0.f), + u_mirror: U_Mirror, + v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: mapChannel - 1) + ), + wrap_u: U_Tile ? tex::wrap_repeat : U_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + wrap_v: V_Tile ? tex::wrap_repeat : V_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip + ); +} + +// 3dsmax Color Correction RGB Channels +export enum ad_3dsmax_channel +[[ + anno::hidden() +]] +{ + channel_red, + channel_green, + channel_blue, + channel_alpha, + channel_inverse_red, + channel_inverse_green, + channel_inverse_blue, + channel_inverse_alpha, + channel_mono, + channel_one, + channel_zero +}; + +// 3dsmax Color Correction Lightness Mode +export enum ad_3dsmax_lightness_mode +[[ + anno::hidden() +]] +{ + Standard, + Advanced +}; + +// 3dsmax Color Correction Map +export texture_return ad_3dsmax_color_correction +( + texture_return map = texture_return() + [[ + anno::in_group("Basic parameters"), + anno::display_name("Color") + ]], + uniform ad_3dsmax_channel rewireR = channel_red + [[ + anno::in_group("Channels"), + anno::display_name("Red") + ]], + uniform ad_3dsmax_channel rewireG = channel_green + [[ + anno::in_group("Channels"), + anno::display_name("Green") + ]], + uniform ad_3dsmax_channel rewireB = channel_blue + [[ + anno::in_group("Channels"), + anno::display_name("Blue") + ]], + uniform ad_3dsmax_channel rewireA = channel_alpha + [[ + anno::in_group("Channels"), + anno::display_name("Alpha") + ]], + uniform float hue_shift = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Hue shift"), + anno::hard_range(-180.f, 180.f) + ]], + uniform float saturation = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Saturation"), + anno::hard_range(-100.f, 100.f) + ]], + uniform float hue_tint = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Hue tint"), + anno::hard_range(0.f, 360.f) + ]], + uniform float hue_tint_amnt = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Strength"), + anno::hard_range(0.f, 100.f) + ]], + uniform ad_3dsmax_lightness_mode lightness_mode = Standard + [[ + anno::in_group("Lightness"), + anno::display_name("Lightness mode") + ]], + uniform float brightness = 0.f + [[ + anno::in_group("Lightness"), + anno::display_name("Brightness"), + anno::hard_range(-100.f, 100.f) + ]], + uniform float contrast = 0.f + [[ + anno::in_group("Lightness"), + anno::display_name("Contrast"), + anno::hard_range(-100.f, 100.f) + ]], + uniform float rgb_gamma = 1.f + [[ + anno::in_group("Lightness"), + anno::display_name("RGB gamma"), + anno::hard_range(0.01f, 10000.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + // channel rewiring + float3 rgb = float3(map.tint); + texture_return result = (rewireB == channel_blue) && (rewireG == channel_green) && (rewireR == channel_red) && (rewireA == channel_alpha) ? + texture_return(color(rgb), map.mono) : + texture_return(color( + rewireR == channel_red ? rgb.x : + rewireR == channel_green ? rgb.y : + rewireR == channel_blue ? rgb.z : + rewireR == channel_alpha ? map.mono : + rewireR == channel_inverse_red ? 1.f - rgb.x : + rewireR == channel_inverse_green ? 1.f - rgb.y : + rewireR == channel_inverse_blue ? 1.f - rgb.z : + rewireR == channel_inverse_alpha ? 1.f - map.mono : + rewireR == channel_mono ? math::luminance(map.tint) : + rewireR == channel_one ? 1.f : 0.f, + rewireG == channel_red ? rgb.x : + rewireG == channel_green ? rgb.y : + rewireG == channel_blue ? rgb.z : + rewireG == channel_alpha ? map.mono : + rewireG == channel_inverse_red ? 1.f - rgb.x : + rewireG == channel_inverse_green ? 1.f - rgb.y : + rewireG == channel_inverse_blue ? 1.f - rgb.z : + rewireG == channel_inverse_alpha ? 1.f - map.mono : + rewireG == channel_mono ? math::luminance(map.tint) : + rewireG == channel_one ? 1.f : 0.f, + rewireB == channel_red ? rgb.x : + rewireB == channel_green ? rgb.y : + rewireB == channel_blue ? rgb.z : + rewireB == channel_alpha ? map.mono : + rewireB == channel_inverse_red ? 1.f - rgb.x : + rewireB == channel_inverse_green ? 1.f - rgb.y : + rewireB == channel_inverse_blue ? 1.f - rgb.z : + rewireB == channel_inverse_alpha ? 1.f - map.mono : + rewireB == channel_mono ? math::luminance(map.tint) : + rewireB == channel_one ? 1.f : 0.f + ), + rewireA == channel_red ? rgb.x : + rewireA == channel_green ? rgb.y : + rewireA == channel_blue ? rgb.z : + rewireA == channel_alpha ? map.mono : + rewireA == channel_inverse_red ? 1.f - rgb.x : + rewireA == channel_inverse_green ? 1.f - rgb.y : + rewireA == channel_inverse_blue ? 1.f - rgb.z : + rewireA == channel_inverse_alpha ? 1.f - map.mono : + rewireA == channel_mono ? math::luminance(map.tint) : + rewireA == channel_one ? 1.f : 0.f); + + rgb = float3(result.tint); + + // chroma correction + if(hue_shift != 0.f || saturation != 0.f || hue_tint_amnt != 0.f) + { + // RGB to HSV + float min = math::min_value(rgb); + float max = math::max_value(rgb); + float h = 0.f, s = 0.f, v = max; + float delta = max - min; + + if(min != max) + { + if(max == rgb.x) + h = math::fmod(((60.f*((rgb.y - rgb.z)/delta)) + 360.f), 360.f); + else if(max == rgb.y) + h = math::fmod(((60.f*((rgb.z - rgb.x)/delta)) + 120.f), 360.f); + else // max == rgb.z + h = math::fmod(((60.f*((rgb.x - rgb.y)/delta)) + 240.f), 360.f); + } + + if(max > 0.f) + { + s = delta / max; + + if(saturation >= 0.f) + s += saturation*saturation*0.0001f; + else + s -= saturation*saturation*0.0001f; + + if(s < 0.f) + s = 0.f; + else if (s > 1.f) + s = 1.f; + } + + // apply cromatic corrections + h += hue_shift; + h += (hue_tint - h)*(hue_tint_amnt*0.01f); + + if(h < 0.f) + h += 360.f; + else if(h >= 360.f) + h -= 360.f; + + + // HSV to RGB + float sv = s*v; + h = math::fmod(h / 60.f, 6.f); + int idx = int(h); + float x = sv * (1.f - math::abs(math::fmod(h, 2.f) - 1.f)); + float m = v - sv; + + float r=0.f, g=0.f, b=0.f; + + switch(idx) + { + case 0: + r = sv, g = x; + break; + case 1: + r = x, g = sv; + break; + case 2: + g = sv, b = x; + break; + case 3: + g = x, b = sv; + break; + case 4: + r = x, b = sv; + break; + case 5: + r = sv, b = x; + break; + } + + rgb = float3(r+m, g+m, b+m); + } + + // lightness correction + if(lightness_mode == Advanced) // advanced exposure + { + if(rgb_gamma != 1.f) + rgb = math::pow(rgb, 1.f/rgb_gamma); + } + else // basic exposure + { + if(contrast != 0.f) + { + float c = contrast*2.55f; + float f = (259.f * (c + 255.f))/(255.f * (259.f - c)); + float3 grey(0.5f); + rgb = math::clamp((rgb - grey)*f + grey, 0.f, 1.f); + } + + if(brightness != 0.f) + { + rgb = math::clamp(rgb + float3(brightness*0.01), 0.f, 1.f); + } + } + + result.tint = color(rgb); + return result; +} + +// 3dsmax Color Correction Map for Bump +export float3 ad_3dsmax_color_correction_bump( + float3 map = state::normal() + [[ + anno::in_group("Basic parameters"), + anno::display_name("Bump map") + ]], + uniform ad_3dsmax_channel rewireR = channel_red + [[ + anno::in_group("Channels"), + anno::display_name("Red"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_channel rewireG = channel_green + [[ + anno::in_group("Channels"), + anno::display_name("Green"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_channel rewireB = channel_blue + [[ + anno::in_group("Channels"), + anno::display_name("Blue"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_channel rewireA = channel_alpha + [[ + anno::in_group("Channels"), + anno::display_name("Alpha"), + anno::unused(), + anno::hidden() + ]], + uniform float hue_shift = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Hue shift"), + anno::hard_range(-180.f, 180.f), + anno::unused(), + anno::hidden() + ]], + uniform float saturation = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Saturation"), + anno::hard_range(-100.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform float hue_tint = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Hue tint"), + anno::hard_range(0.f, 360.f), + anno::unused(), + anno::hidden() + ]], + uniform float hue_tint_amnt = 0.f + [[ + anno::in_group("Color"), + anno::display_name("Strength"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_lightness_mode lightness_mode = Standard + [[ + anno::in_group("Lightness"), + anno::display_name("Lightness mode"), + anno::unused(), + anno::hidden() + ]], + uniform float brightness = 0.f + [[ + anno::in_group("Lightness"), + anno::display_name("Brightness"), + anno::hard_range(-100.f, 100.f), + anno::unused(), + anno::hidden() + + ]], + uniform float contrast = 0.f + [[ + anno::in_group("Lightness"), + anno::display_name("Contrast"), + anno::hard_range(-100.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_gamma = 1.f + [[ + anno::in_group("Lightness"), + anno::display_name("RGB gamma"), + anno::hard_range(0.01f, 10000.f), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Bump"), + anno::display_name("Bump amount"), + anno::hard_range(0.f, 1.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return math::normalize(math::lerp(state::normal(), map, bump_amount)); + // return combine_normals(bump_amount, map, 1.f - bump_amount, state::normal()); + + // EXPERIMENTAL CODE + // if(bump_amount <= 0.f) + // return state::normal(); + + // // normal xyz to spherical + // float disc = math::sqrt(map.x*map.x + map.y*map.y); + // float theta = math::atan(disc/map.z); + // float phi = math::atan2(map.y, map.x); + + // float t = math::clamp(1.f - theta/math::HALF_PI, 0.f, 1.f); // [0, PI/2] --> [1, 0] mapping + + + // // lightness corrections + // if(lightness_mode = Advanced) + // { + // if(rgb_gamma != 1.f) + // t = math::pow(t, 1.f/rgb_gamma); + // } + // else // basic exposure + // { + // if(contrast != 0.f) + // { + // float c = contrast*2.55f; + // float f = (259.f * (c + 255.f))/(255.f * (259.f - c)); + // t = math::clamp((t - 0.5f)*f + 0.5f, 0.f, 1.f); + // } + + // if(brightness != 0.f) + // { + // t = math::clamp(t + (brightness*0.01), 0.f, 1.f); + // } + // } + + // theta = (1.f - t)*math::HALF_PI; // [1, 0] --> [0, PI/2] mapping + + // // normal spherical to xyz + // float3 bump_normal(math::sin(theta)*math::cos(phi), math::sin(theta)*math::sin(phi), math::cos(theta)); + + // if(bump_amount >= 1.f) + // return bump_normal; + // else + // return combine_normals(bump_amount, bump_normal, 1.f - bump_amount, state::normal()); +} + +// 3dsmax Composite Layer Mask Mode +uniform color_layer_mode ad_3dsmax_mapmode(uniform int m) +{ + return + m == 0 ? base::color_layer_blend: + m == 1 ? base::color_layer_average: + m == 2 ? base::color_layer_add: + m == 3 ? base::color_layer_add: //but factor is negative to get subtract!! + m == 4 ? base::color_layer_darken: + m == 5 ? base::color_layer_multiply: + m == 6 ? base::color_layer_colorburn: + m == 7 ? base::color_layer_linearburn: + m == 8 ? base::color_layer_lighten: + m == 9 ? base::color_layer_screen: + m == 10 ? base::color_layer_colordodge: + m == 11 ? base::color_layer_lineardodge: + m == 12 ? base::color_layer_spotlight: + m == 13 ? base::color_layer_spotlightblend: + m == 14 ? base::color_layer_overlay: + m == 15 ? base::color_layer_softlight: + m == 16 ? base::color_layer_hardlight: + m == 17 ? base::color_layer_pinlight: + m == 18 ? base::color_layer_hardmix: + m == 19 ? base::color_layer_difference: + m == 20 ? base::color_layer_exclusion: + m == 21 ? base::color_layer_hue: + m == 22 ? base::color_layer_saturation: + m == 23 ? base::color_layer_color: + m == 24 ? base::color_layer_brightness: + base::color_layer_blend; +} + +// 3dsmax Composite Map +export texture_return ad_3dsmax_composite +( + // layer 1 + uniform int blendMode1 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Blend Mode (unused)"), + anno::unused(), + anno::hidden() + ]], + texture_return map1 = texture_return() + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Map") + ]], + texture_return mask1 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Mask") + ]], + uniform float opacity1 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // layer2 + uniform int blendMode2 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Blend Mode") + ]], + texture_return map2 = texture_return() + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Map") + ]], + texture_return mask2 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Mask") + ]], + uniform float opacity2 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // layer3 + uniform int blendMode3 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Blend Mode") + ]], + texture_return map3 = texture_return() + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Map") + ]], + texture_return mask3 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Mask") + ]], + uniform float opacity3 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // Layer4 + uniform int blendMode4 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Blend Mode") + ]], + texture_return map4 = texture_return() + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Map") + ]], + texture_return mask4 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Mask") + ]], + uniform float opacity4 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Opacity"), + anno::hard_range(0.f, 100.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + opacity1 *= mask1.mono*0.01f; + texture_return t1 = opacity1 > 0.f ? + base::blend_color_layers + ( + layers: base::color_layer[] + ( + base::color_layer + ( + layer_color: map1.tint, + weight: opacity1, + mode: base::color_layer_blend + ) + ), + base: color(0.f) + ) + : texture_return(color(0.f), 0.f); + + opacity2 *= mask2.mono*0.01f; + texture_return t2 = opacity2 > 0.f ? + base::blend_color_layers + ( + layers: base::color_layer[] + ( + base::color_layer + ( + layer_color: map2.tint, + weight: blendMode2 == 3 ? -opacity2 : opacity2, + mode: ad_3dsmax_mapmode(blendMode2) + ) + ), + base: t1.tint + ) + : t1; + + opacity3 *= mask3.mono*0.01f; + texture_return t3 = opacity3 > 0.f ? + base::blend_color_layers + ( + layers: base::color_layer[] + ( + base::color_layer + ( + layer_color: map3.tint, + weight: blendMode3 == 3 ? -opacity3 : opacity3, + mode: ad_3dsmax_mapmode(blendMode3) + ) + ), + base: t2.tint + ) + : t2; + + opacity4 *= mask4.mono*0.01f; + texture_return t4 = opacity4 > 0.f ? + base::blend_color_layers + ( + layers: base::color_layer[] + ( + base::color_layer + ( + layer_color: map4.tint, + weight: blendMode4 == 3 ? -opacity4 : opacity4, + mode: ad_3dsmax_mapmode(blendMode4) + ) + ), + base: t3.tint + ): + t3; + + return t4; +} + +// 3dsmax Composite Map for Bump +export float3 ad_3dsmax_composite_bump +( + // Layer1 + uniform int blendMode1 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Blend Mode"), + anno::unused(), + anno::hidden() + ]], + float3 map1 = state::normal() + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Bump Map") + ]], + texture_return mask1 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Mask") + ]], + uniform float opacity1 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("1: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // Layer2 + uniform int blendMode2 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Blend Mode"), + anno::unused(), + anno::hidden() + ]], + float3 map2 = state::normal() + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Bump Map") + ]], + texture_return mask2 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Mask") + ]], + uniform float opacity2 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("2: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // Layer3 + uniform int blendMode3 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Blend Mode"), + anno::unused(), + anno::hidden() + ]], + float3 map3 = state::normal() + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Bump Map") + ]], + texture_return mask3 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Mask") + ]], + uniform float opacity3 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("3: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + // Layer4 + uniform int blendMode4 = 0 + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Blend Mode"), + anno::unused(), + anno::hidden() + ]], + float3 map4 = state::normal() + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Bump Map") + ]], + texture_return mask4 = texture_return(color(1.f), 1.f) + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Mask") + ]], + uniform float opacity4 = 0.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("4: Opacity"), + anno::hard_range(0.f, 100.f) + ]], + uniform float factor = 1.f + [[ + anno::in_group("Composite Layers"), + anno::display_name("Bump amount") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 n1 = opacity1 > 0.f ? + combine_normals(1.f - (opacity1/100.f*mask1.mono), state::normal(), opacity1/100.f*factor*mask1.mono, map1) + : state::normal(); + + float3 n2 = opacity2 > 0.f ? + combine_normals(1.f - (opacity2/100.f*mask2.mono), n1, opacity2/100.f*factor*mask2.mono, map2) + : n1; + + float3 n3 = opacity3 > 0.f ? + combine_normals(1.f - (opacity3/100.f*mask3.mono), n2, opacity3/100.f*factor*mask3.mono, map3) + : n2; + + float3 n4 = opacity4 > 0.f ? + combine_normals(1.f - (opacity4/100.f*mask4.mono), n3, opacity4/100.f*factor*mask4.mono, map4) + : n3; + + return n4; +} + +// 3dsmax Dent Map +export texture_return ad_3dsmax_dent +( + // Dent Params + color color1 = color(0.f) + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Color #1") + ]], + color color2 = color(1.f) + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Color #2") + ]], + uniform float size = 200.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Size") + ]], + uniform float strength = 20.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Strength") + ]], + uniform int iterations = 2 + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Iterations") + ]], + + // Coords + uniform float blur = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur"), + anno::unused() + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + // coordType: Object XYZ = 0, World XYZ = 1, Explicit Map Channel = 2, Vertex Color Channel = 3 + uniform int coordType = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("Source") + ]], + uniform int mapChannel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return base::perlin_noise_texture + ( + color1: color1, + color2: color2, + size: size / 30.0, // Experimental factor to improve the match + noise_levels: iterations, + absolute_noise: true, // Dent is absolute noise + noise_threshold_high: (strength != 0 ? 1/(strength) : 1), // Match seems rather close + apply_dent: true, + uvw: base::transform_coordinate + ( + transform: base::rotation_translation_scale + ( + scaling: tiling, + translation: offset, + rotation: float3(angle.x,angle.y,angle.z)/180.*math::PI + ), + coordinate: + ( + coordType == 0 ? // Object XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + ( + coordType == 1 ? // World XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_world): + ( + // coordType == 2 ? // Explicit Map Channel + // base::coordinate_source(texture_space: mapChannel-1): + base::coordinate_source(texture_space: mapChannel-1) // No support for Vertex Color Channel, fallback to UVs + ) + ) + ) + ) + ); +} + +// 3dsmax Dent Map for Bump +export float3 ad_3dsmax_dent_bump +( + // Dent Params + color color1 = color(0.f) + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Color #1") + ]], + color color2 = color(1.f) + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Color #2") + ]], + uniform float size = 200.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Size") + ]], + uniform float strength = 20.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Strength") + ]], + uniform int iterations = 2 + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Iterations") + ]], + + // Bump + uniform float factor = 1.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Bump amount") + ]], + + // Coords + uniform float blur = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur"), + anno::unused(), + anno::hidden() + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + // coordType: Object XYZ = 0, World XYZ = 1, Explicit Map Channel = 2, Vertex Color Channel = 3 + uniform int coordType = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("Source") + ]], + uniform int mapChannel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 perlin_normal = base::perlin_noise_bump_texture + ( + factor: factor * (strength / 100.f), // Experimental + size: size / 30.f, // Experimental factor to improve the match + noise_levels: iterations, + absolute_noise: true, // Dent is absolute noise + apply_dent: true, + uvw: base::transform_coordinate + ( + transform: base::rotation_translation_scale + ( + scaling: tiling, + translation: offset, + rotation: float3(angle.x,angle.y,angle.z)/180.f*math::PI + ), + coordinate: + ( + coordType == 0 ? // Object XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + ( + coordType == 1 ? // World XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_world): + ( + // coordType == 2 ? // Explicit Map Channel + // base::coordinate_source(texture_space: mapChannel-1): + base::coordinate_source(texture_space: mapChannel-1) // No support for Vertex Color Channel, fallback to UVs + ) + ) + ) + ) + ); + float f = math::average(color1 - color2) * factor; + return combine_normals( f, perlin_normal, 1.f - f, state::normal() ); +} + +// 3dsmax Gradient Ramp Map +export enum ad_3dsmax_gradient_interpolation +{ + custom = 0, + easy_in, + easy_in_out, + easy_out, + linear, + solid +}; + + +export texture_return ad_3dsmax_gradient_ramp +( + // Gradient Params + uniform float[] gradient_keys = float[](0.f, 50.f, 100.f) + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Keys") + ]], + uniform float3[] gradient_colors = float3[](float3(0.f, 0.f, 0.f), float3(0.5f, 0.5f, 0.5f), float3(1.f, 1.f, 1.f)) + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Colors") + ]], + uniform int gradient_type = 4 + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Type"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_gradient_interpolation gradient_interpolation = linear + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Interpolation") + ]], + + // Noise Params + uniform float amount = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Amount"), + anno::hard_range(0.f, 1.f) + ]], + // type: regular = 0, fractal = 1, turbulence = 2 + // 0- Regular (Generates plain noise. Basically the same as fractal noise with levels at 1.) + // 1- Fractal (Generates noise using a fractal algorithm. levels sets the number of iterations for the fractal noise.) + // 2- Turbulence (Generates fractal noise with an absolute value function applied to it to make fault lines.) + uniform int type = 0 + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Type") + ]], + uniform float size = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Size") + ]], + uniform float phase = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Phase") + ]], + uniform float levels = 4.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Levels") + ]], + uniform float threshold_low = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold Low") + ]], + uniform float threshold_high = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold High") + ]], + uniform float threshold_smooth = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold Smooth"), + anno::unused(), + anno::hidden() + ]], + + // Coords + uniform int map_channel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform bool u_tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool v_tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool u_mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool v_mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + uniform int UVW_Type = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW_Type"), + anno::unused(), + anno::hidden() + ]], + + // Output + uniform bool alpha_from_RGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB Intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump Amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output Amount"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Level"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + texture_return noise; + + if(amount > 0.f) + { + noise = base::perlin_noise_texture + ( + size: size/30.f, + noise_phase: phase, + noise_levels: (type == 0 ? 1 : int(levels)), // Levels only used for fractal and turbulence noise types + absolute_noise: type == 2, // If set to true, the appearance of the pattern will be more "billowing" and "turbulent" + noise_threshold_high: threshold_high, + noise_threshold_low: threshold_low, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: tiling, + rotation: angle/180.f*math::PI , + translation: offset, + u_mirror: u_mirror, + v_mirror: v_mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + } + + float3 position = state::texture_coordinate(0); + + float t = position.x + noise.mono*amount; + + t = t - int(t); + if( t < 0.f) + t += 1.f; + else if( t > 1.f) + t -= 1.f; + + t *= 100.f; + + int idx=0; + for(int i=0; i= t) + { + idx = i; + break; + } + } + + color c; + switch(gradient_interpolation) + { + case easy_in: + t = (t - gradient_keys[idx])/(gradient_keys[idx+1] - gradient_keys[idx]); + c = color(math::lerp( gradient_colors[idx], gradient_colors[idx+1], t*t)); + break; + case easy_in_out: + t = (t - gradient_keys[idx])/(gradient_keys[idx+1] - gradient_keys[idx]); + c = color(math::lerp( gradient_colors[idx], gradient_colors[idx+1], t*t*(3.f - 2.f*t))); + break; + case easy_out: + t = (t - gradient_keys[idx])/(gradient_keys[idx+1] - gradient_keys[idx]); + c = color(math::lerp( gradient_colors[idx], gradient_colors[idx+1], math::sqrt(t))); + break; + default: + case linear: + t = (t - gradient_keys[idx])/(gradient_keys[idx+1] - gradient_keys[idx]); + c = color(math::lerp( gradient_colors[idx], gradient_colors[idx+1], t)); + break; + case solid: + c = color(gradient_colors[idx]); + break; + } + + return texture_return(c, math::average(c)); +} + +// 3dsmax Gradient Ramp Map for Bump +export float3 ad_3dsmax_gradient_ramp_bump +( + // Gradient Params + uniform float[] gradient_keys = float[](0.f, 50.f, 100.f) + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Keys"), + anno::unused(), + anno::hidden() + + ]], + uniform float3[] gradient_colors = float3[](float3(0.f, 0.f, 0.f), float3(0.5f, 0.5f, 0.5f), float3(1.f, 1.f, 1.f)) + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Colors"), + anno::unused(), + anno::hidden() + ]], + uniform int gradient_type = 5 + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Gradient Type"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_gradient_interpolation gradient_interpolation = linear + [[ + anno::in_group("Gradient Parameters"), + anno::display_name("Interpolation"), + anno::unused(), + anno::hidden() + ]], + + // Noise Params + uniform float amount = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Amount"), + anno::hard_range(0.f, 1.f) + ]], + // type: regular = 0, fractal = 1, turbulence = 2 + // 0- Regular (Generates plain noise. Basically the same as fractal noise with levels at 1.) + // 1- Fractal (Generates noise using a fractal algorithm. levels sets the number of iterations for the fractal noise.) + // 2- Turbulence (Generates fractal noise with an absolute value function applied to it to make fault lines.) + uniform int type = 0 + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Type") + ]], + uniform float size = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Size") + ]], + uniform float phase = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Phase") + ]], + uniform float levels = 4.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Levels") + ]], + uniform float threshold_low = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold Low") + ]], + uniform float threshold_high = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold High") + ]], + uniform float threshold_smooth = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Threshold Smooth"), + anno::unused(), + anno::hidden() + ]], + + // Bump + uniform float factor = 1.f + [[ + anno::in_group("Bump Parameters"), + anno::display_name("Bump factor") + ]], + + // Coords + uniform int map_channel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform bool u_tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool v_tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool u_mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool v_mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + uniform int UVW_Type = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW_Type"), + anno::unused(), + anno::hidden() + ]], + + // Output + uniform bool alpha_from_RGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB Intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump Amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output Amount"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Level"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 perlin_normal = base::perlin_noise_bump_texture + ( + factor: factor, + size: size/30.f, + noise_phase: phase, + noise_levels: (type == 0 ? 1 : int(levels)), // Levels only used for fractal and turbulence noise types + absolute_noise: type == 2, // If set to true, the appearance of the pattern will be more "billowing" and "turbulent" + noise_threshold_high: threshold_high, + noise_threshold_low: threshold_low, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: tiling, + rotation: angle/180.f*math::PI , + translation: offset, + u_mirror: u_mirror, + v_mirror: v_mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + // return combine_normals( factor, perlin_normal, 1.f-factor, state::normal() ); + + return math::normalize(math::lerp(state::normal(), perlin_normal, factor*amount)); + +} + + +// 3dsmax Falloff Map Type +export enum ad_3dsmax_falloff_Type +[[ + anno::hidden() +]] +{ + Towards_Away, + Perpendicular_Parallel, + Fresnel, + Shadow_Light, + Distance_Blend +}; + +// 3dsmax Falloff Map directions +export enum ad_3dsmax_falloff_direction +[[ + anno::hidden() +]] +{ + View, + Camera_X, + Camera_Y, + Object, + Local_X, + Local_Y, + Local_Z, + World_X, + World_Y, + World_Z +}; + +// 3dsmax Falloff Map +export texture_return ad_3dsmax_falloff +( + texture_return color1 = texture_return() + [[ + anno::in_group("Falloff"), + anno::display_name("Color #1") + ]], + texture_return color2 = texture_return() + [[ + anno::in_group("Falloff"), + anno::display_name("Color #1"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_falloff_Type falloff_type = Perpendicular_Parallel + [[ + anno::in_group("Falloff"), + anno::display_name("Falloff type"), + anno::unused(), + anno::hidden() + ]], + uniform ad_3dsmax_falloff_direction falloff_direction = View + [[ + anno::in_group("Falloff"), + anno::display_name("Falloff direction"), + anno::unused(), + anno::hidden() + ]], + float4x4 node = float4x4() + [[ + anno::in_group("Falloff"), + anno::display_name("Node"), + anno::unused(), + anno::hidden() + ]], + uniform float nearDistance = 0.f + [[ + anno::in_group("Falloff"), + anno::display_name("Near distance"), + anno::unused(), + anno::hidden() + ]], + uniform float farDistance = 1000000.f + [[ + anno::in_group("Falloff"), + anno::display_name("Far distance"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return color1; +} + +// 3dsmax Mix Map +export texture_return ad_3dsmax_mix +( + texture_return color1 = texture_return() + [[ + anno::in_group("Mix parameters"), + anno::display_name("Color #1") + ]], + texture_return color2 = texture_return() + [[ + anno::in_group("Mix parameters"), + anno::display_name("Color #2") + ]], + float mixAmount = 0.f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Mix amount"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool useCurve = false + [[ + anno::in_group("Mix parameters"), + anno::display_name("Use curve") + ]], + uniform float lower = 0.3f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Lower"), + anno::hard_range(0.f, 1.f) + ]], + uniform float upper = .7f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Upper"), + anno::hard_range(0.f, 1.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float t = useCurve ? math::smoothstep(lower, upper, mixAmount) : math::smoothstep(0.0, 1.0, mixAmount); + + return texture_return( + math::lerp(color1.tint,color2.tint, t), + math::lerp(color1.mono,color2.mono, t)); +} + +// 3dsmax Mix Map for Bump +export float3 ad_3dsmax_mix_bump +( + float3 color1 = state::normal() + [[ + anno::in_group("Mix parameters"), + anno::display_name("Bump Map #1") + ]], + float3 color2 = state::normal() + [[ + anno::in_group("Mix parameters"), + anno::display_name("Bump Map #2") + ]], + float mixAmount = 0.f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Mix amount"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool useCurve = false + [[ + anno::in_group("Mix parameters"), + anno::display_name("Use Curve") + ]], + uniform float lower = 0.3f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Lower"), + anno::hard_range(0.f, 1.f) + ]], + uniform float upper = .7f + [[ + anno::in_group("Mix parameters"), + anno::display_name("Upper"), + anno::hard_range(0.f, 1.f) + ]], + + // Bump + uniform float bump_amount = 1.f + [[ + anno::in_group("Dent Parameters"), + anno::display_name("Bump amount") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float t = useCurve ? math::smoothstep(lower, upper, mixAmount) : math::smoothstep(0.0, 1.0, mixAmount); + float3 mix_normal = math::normalize(math::lerp(color1, color2, t)); + + return math::normalize(math::lerp(state::normal(), mix_normal, bump_amount)); +} + +// 3dsmax Noise Map +export texture_return ad_3dsmax_noise +( + // Noise Params + color color1 = color(0.f) + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Color #1") + ]], + color color2 = color(1.f) + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Color #2") + ]], + uniform float size = 25.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Size") + ]], + uniform float phase = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Phase") + ]], + uniform float levels = 3.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Levels") + ]], + uniform float thresholdLow = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Threshold Low") + ]], + uniform float thresholdHigh = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Threshold High") + ]], + // type: regular = 0, fractal = 1, turbulence = 2 + // 0- Regular (Generates plain noise. Basically the same as fractal noise with levels at 1.) + // 1- Fractal (Generates noise using a fractal algorithm. levels sets the number of iterations for the fractal noise.) + // 2- Turbulence (Generates fractal noise with an absolute value function applied to it to make fault lines.) + uniform int type = 1 + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Type") + ]], + + // Coords + uniform float blur = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur"), + anno::unused(), + anno::hidden() + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + // coordType: Object XYZ = 0, World XYZ = 1, Explicit Map Channel = 2, Vertex Color Channel = 3 + uniform int coordType = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("Source") + ]], + uniform int mapChannel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]], + + // Output + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB Intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump Amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output Amount"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Level"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return base::perlin_noise_texture + ( + color1: color1, + color2: color2, + size: size/30.f, + noise_phase: phase, + noise_levels: (type == 0 ? 1 : int(levels)), // Levels only used for fractal and turbulence noise types + absolute_noise: type == 2, // If set to true, the appearance of the pattern will be more "billowing" and "turbulent" + noise_threshold_high: thresholdHigh, + noise_threshold_low: thresholdLow, + uvw: base::transform_coordinate + ( + transform: base::rotation_translation_scale + ( + scaling: tiling, + translation: offset, + rotation: float3(angle.x,angle.y,angle.z)/180.*math::PI + ), + coordinate: + ( + coordType == 0 ? // Object XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + ( + coordType == 1 ? // World XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_world): + ( + // coordType == 2 ? // Explicit Map Channel + // base::coordinate_source(texture_space: mapChannel-1): + base::coordinate_source(texture_space: mapChannel-1) // No support for Vertex Color Channel, fallback to UVs + ) + ) + ) + ) + ); +} + +// 3dsmax Noise Map for Bump +export float3 ad_3dsmax_noise_bump +( + // Noise Params + color color1 = color(0.f) + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Color #1") + ]], + color color2 = color(1.f) + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Color #2") + ]], + uniform float size = 25.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Size") + ]], + uniform float phase = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Phase") + ]], + uniform float levels = 3.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Levels") + ]], + uniform float thresholdLow = 0.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Threshold Low") + ]], + uniform float thresholdHigh = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Threshold High") + ]], + // type: regular = 0, fractal = 1, turbulence = 2 + // 0- Regular (Generates plain noise. Basically the same as fractal noise with levels at 1.) + // 1- Fractal (Generates noise using a fractal algorithm. levels sets the number of iterations for the fractal noise.) + // 2- Turbulence (Generates fractal noise with an absolute value function applied to it to make fault lines.) + uniform int type = 1 + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Noise Type") + ]], + + // Bump + uniform float factor = 1.f + [[ + anno::in_group("Noise Parameters"), + anno::display_name("Bump amount") + ]], + + // Coords + uniform float blur = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur"), + anno::unused(), + anno::hidden() + ]], + uniform float3 offset = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Offset") + ]], + uniform float3 tiling = float3(1.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Tiling") + ]], + uniform float3 angle = float3(0.f) + [[ + anno::in_group("Coordinates"), + anno::display_name("Angle") + ]], + uniform float blur_Offset = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("Blur Offset"), + anno::unused(), + anno::hidden() + ]], + // coordType: Object XYZ = 0, World XYZ = 1, Explicit Map Channel = 2, Vertex Color Channel = 3 + uniform int coordType = 0 + [[ + anno::in_group("Coordinates"), + anno::display_name("Source") + ]], + uniform int mapChannel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map Channel") + ]], + + // Output + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB Intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.0 + [[ + anno::in_group("Output"), + anno::display_name("Bump Amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.0 + [[ + anno::in_group("Output"), + anno::display_name("Output Amount"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_level = 1.0 + [[ + anno::in_group("Output"), + anno::display_name("RGB Level"), + anno::unused(), + anno::hidden() + ]], + uniform float rgb_offset = 0.0 + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 perlin_normal = base::perlin_noise_bump_texture + ( + factor: factor, + size: size/30.f, + noise_phase: phase, + noise_levels: (type == 0 ? 1 : int(levels)), // Levels only used for fractal and turbulence noise types + absolute_noise: type == 2, // If set to true, the appearance of the pattern will be more "billowing" and "turbulent" + noise_threshold_high: thresholdHigh, + noise_threshold_low: thresholdLow, + uvw: base::transform_coordinate + ( + transform: base::rotation_translation_scale + ( + scaling: tiling, + translation: offset, + rotation: float3(angle.x,angle.y,angle.z)/180.*math::PI + ), + coordinate: + ( + coordType == 0 ? // Object XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_object): + ( + coordType == 1 ? // World XYZ + base::coordinate_source(coordinate_system: base::texture_coordinate_world): + ( + // coordType == 2 ? // Explicit Map Channel + // base::coordinate_source(texture_space: mapChannel-1): + base::coordinate_source(texture_space: mapChannel-1) // No support for Vertex Color Channel, fallback to UVs + ) + ) + ) + ) + ); + float f = math::average(color1 - color2) * factor; + return combine_normals( f, perlin_normal, 1-f, state::normal() ); +} + +// 3dsmax Output Map +export texture_return ad_3dsmax_output +( + texture_return MAP1 = texture_return() + [[ + anno::in_group("Output Parameters"), + anno::display_name("Map") + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("Bump amount"), + anno::unused() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Clamp") + ]], + uniform bool invert = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Alpha from RGB intensity") + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("Output amount"), + anno::unused() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("RGB level") + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("RGB offset") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + color rgb(MAP1.tint*rgb_level + rgb_offset); + + if(clamp || invert) + rgb = math::clamp(rgb, 0.f, 1.f); + + if(invert) + rgb = color(1.f) - rgb; + + return texture_return(rgb, alphaFromRGB ? math::luminance(rgb) : MAP1.mono); + +} + +// 3dsmax Output Map for Bump +export float3 ad_3dsmax_output_bump +( + float3 MAP1 = state::normal() + [[ + anno::in_group("Output Parameters"), + anno::display_name("Map") + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("Bump amount") + ]], + uniform bool clamp = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Clamp"), + anno::unused() + ]], + uniform bool invert = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output Parameters"), + anno::display_name("Alpha from RGB intensity"), + anno::unused() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("Output amount"), + anno::unused() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("RGB level"), + anno::unused() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output Parameters"), + anno::display_name("RGB offset"), + anno::unused() + ]], + uniform float base_bump_amount = 1.f + [[ + anno::in_group("Bump"), + anno::display_name("Base bump amount"), + anno::hard_range(0.f, 1.f) + ]] + +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 normal = MAP1; + if(invert) + { + normal = transform_internal_to_tangent(normal); + normal = float3(-normal.x, -normal.y, normal.z); + normal = transform_tangent_to_internal(normal); + } + + return math::normalize(math::lerp(state::normal(), normal, bump_amount*base_bump_amount)); +} + +int rnd_next(int seed) { + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + return math::abs(float(seed) * 4.6566e-10f); +} + +// Convert from the HSV color model to the RGB color model +float3 hsv_to_rgb(float3 hsv) +{ + // grayscale? + if(hsv.y < limits::FLOAT_MIN) + return float3(hsv.z); + + float h_prime = (hsv.x < 1.0f) ? hsv.x * 6.0f : 0.0f; // H * 360.0/60.0 + float h_floor = math::floor(h_prime); + float f = h_prime - h_floor; + float zy = hsv.z*hsv.y; + float a = hsv.z - zy; + float b = hsv.z - zy*f; + float c = a + zy*f; + + switch(int(h_floor)) + { + default: + // hue out of [0,1] range... + // fall through... + case 0: + return float3(hsv.z, c, a); + case 1: + return float3(b, hsv.z, a); + case 2: + return float3(a, hsv.z, c); + case 3: + return float3(a, b, hsv.z); + case 4: + return float3(c, a, hsv.z); + case 5: + return float3(hsv.z, a, b); + } +} + +// Convert from the RGB color model to the HSV color model +export float3 rgb_to_hsv(float3 rgb) +{ + float max = math::max(rgb.x, math::max(rgb.y, rgb.z)); + float min = math::min(rgb.x, math::min(rgb.y, rgb.z)); + float range = max - min; + + if(range > limits::FLOAT_MIN) + { + float inv_range = (1.0f/6.0f)/range; + + float saturation = (max > limits::FLOAT_MIN) ? (range / max) : 0.0f; + float hue = (saturation != 0.0f) ? + ((max == rgb.x) ? ((rgb.y-rgb.z)*inv_range) // R is max + : (max == rgb.y) ? ((2.0f/6.0f) + (rgb.z-rgb.x)*inv_range) // G is max + : ((4.0f/6.0f) + (rgb.x-rgb.y)*inv_range)) // B is max + : 0.0f; // hue is undefined (assume 0) + + return float3((hue >= 0.0f) ? hue : (hue + 1.0f), saturation, max); + + } + else // grayscale + { + return float3(0.f, 0.f, max); + } +} + +// 3dsmax Tiles map +export texture_return ad_3dsmax_tiles +( + // Coordinates + uniform int map_channel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform bool U_Tile = true //it is actually an error if both mirror and tile are true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool U_Mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool V_Mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle"), + anno::unused(), + anno::hidden() + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused(), + anno::hidden() + ]], + + // Noise + uniform bool use_noise = false + [[ + anno::in_group("Noise"), + anno::display_name("Use Noise") + ]], + uniform float noise_amount = 1.f + [[ + anno::in_group("Noise"), + anno::display_name("Amount"), + anno::hard_range(0.f, 100.f), + anno::enable_if("use_noise") + ]], + uniform int noise_levels = 1 + [[ + anno::in_group("Noise"), + anno::display_name("Levels"), + anno::hard_range(1, 10), + anno::enable_if("use_noise") + ]], + uniform float noise_size = 1.f + [[ + anno::in_group("Noise"), + anno::display_name("Size"), + anno::hard_range(0.001f, 100.f), + anno::enable_if("use_noise") + ]], + uniform float noise_phase = 0.f + [[ + anno::in_group("Noise"), + anno::display_name("Phase"), + anno::hard_range(0.f, 100.f), + anno::enable_if("use_noise") + ]], + +// Standard Controls + uniform int preset_type = 5 + [[ + anno::in_group("Standard Controls"), + anno::display_name("Preset type"), + anno::hard_range(0, 7) + ]], + +// Advanced Controls + color tiles_color = color(0.6f) + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Tiles texture") + ]], + uniform float tiles_horizontal_count = 4.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Horizontal count"), + anno::hard_range(0.f, 100.f) + ]], + uniform float tiles_vertical_count = 4.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Vertical count"), + anno::hard_range(0.f, 100.f) + ]], + uniform float tiles_color_variance = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Color variance"), + anno::hard_range(0.f, 100.f) + ]], + uniform float tiles_fade_variance = 0.05f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Fade variance"), + anno::hard_range(0.f, 100.f) + ]], + color grout_color = color(0.2f) + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Grout texture") + ]], + uniform bool grout_lock_gap_simetry = true + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Gap simetry") + ]], + uniform float grout_horizontal_gap = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Horizontal gap"), + anno::hard_range(0.f, 100.f) + ]], + uniform float grout_vertical_gap = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Vertical gap"), + anno::hard_range(0.f, 100.f), + anno::enable_if("!grout_lock_gap_simetry") + ]], + uniform float grout_percent_holes = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Percent holes"), + anno::hard_range(0.f, 100.f) + ]], + uniform float grout_rought = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Rough"), + anno::hard_range(0.f, 200.f) + ]], + uniform int random_seed = 1444 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Random seed"), + anno::hard_range(0, 65535) + ]], + uniform float line_shift = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Line shift"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform float random_shift = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Random shift"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform bool row_modify = false + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Row modify"), + anno::unused(), + anno::hidden() + ]], + uniform int per_row = 2 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Per row"), + anno::hard_range(0, 50), + anno::unused(), + anno::hidden() + ]], + uniform float per_row_change = 1.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Change"), + anno::hard_range(0.f, 5.f), + anno::unused(), + anno::hidden() + ]], + uniform bool column_modify = false + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Column modify"), + anno::unused(), + anno::hidden() + ]], + uniform int per_column = 2 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Per column"), + anno::hard_range(0, 50), + anno::unused(), + anno::hidden() + ]], + uniform float per_column_change = 1.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Change"), + anno::hard_range(0.f, 5.f), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 uvw = state::texture_coordinate(0); + float2 uv(0.f, 0.f); + + // use noise? + if(use_noise && noise_amount > 0.f) + { + texture_return nx = base::perlin_noise_texture + ( + size: noise_size/30.f, + noise_phase: noise_phase*0.01f, + noise_levels: noise_levels, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: float3(U_Tiling), + rotation: float3(U_angle/180.f*math::PI), + translation: float3(U_Offset), + u_mirror: U_Mirror, + v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + + texture_return ny = base::perlin_noise_texture + ( + size: noise_size/30.f, + noise_phase: noise_phase*0.01f + 0.5f, + noise_levels: noise_levels, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: float3(V_Tiling), + rotation: float3(V_angle/180.f*math::PI), + translation: float3(V_Offset), + u_mirror: U_Mirror, + v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + + uv.x += nx.mono*noise_amount*0.01f; + uv.y += ny.mono*noise_amount*0.01f; + } + + if(grout_rought > 0.f) + { + base::texture_coordinate_info tci; + + tci.position *= 30.f; + tci.position.z = 1.f; + texture_return nx = base::perlin_noise_texture + ( + uvw: tci, + noise_levels: 1, + absolute_noise: true + ); + + tci.position.z = 2.f; + texture_return ny = base::perlin_noise_texture + ( + uvw: tci, + noise_levels: 1, + absolute_noise: true + ); + + uv.x += nx.mono*grout_rought*0.001f; + uv.y += ny.mono*grout_rought*0.001f; + } + + uv += float2((uvw.x - U_Offset)*U_Tiling, (uvw.y - V_Offset)*V_Tiling); + uv = float2(uv.x*tiles_horizontal_count, uv.y*tiles_vertical_count); + + bool is_grout; + + float gap_u = grout_horizontal_gap*0.01f; + float gap_v = grout_lock_gap_simetry ? gap_u : grout_vertical_gap*0.01f; + + gap_u *= tiles_horizontal_count; + gap_v *= tiles_vertical_count; + + int tile_idx = random_seed; + + switch(preset_type) + { + case 1: // running bond + { + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 2: // common flemish bond + { + bool odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + if(odd_row) + { + uv.x = (uv.x + 0.25f)*0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + gap_u *= 0.5f; + + if(math::abs(uv.x) > 0.375f) + tile_idx *= 13; + else if(math::abs(uv.x) > 0.75f) + tile_idx *= 17; + + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + ((uv.x - 0.375f) > -gap_u) && ((uv.x - 0.375f) <= gap_u) || + ((uv.x - 0.75f) > -gap_u) && ((uv.x - 0.75f) <= gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + else + { + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + } + break; + + case 3: // english bond + { + bool odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + uv.x = uv.x*2.f - 0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + gap_u *= 2.f; + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 4: // 1/2 running bond + { + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.25f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 5: // stack bond + { + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 6: // fine running bond + { + bool odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + { + uv *= 2.f; + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.5f; + } + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + { + gap_u *= 2.f; + gap_v *= 2.f; + } + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 7: // fine stack bond + { + bool odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + uv *= 2.f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + { + gap_u *= 2.f; + gap_v *= 2.f; + } + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + default: // checker + is_grout = (math::frac(uv.x) < 0.5f) == (math::frac(uv.y) < 0.5f); + break; + } + + int tile_idx_seed = rnd_next(tile_idx); + float rnd = (rnd_value(tile_idx_seed) - 0.5f); + + // % holes + if(!is_grout) + is_grout = rnd_value(rnd_next(tile_idx_seed)) < grout_percent_holes*0.01f; + + // color variance, fade variance + color tc = tiles_color; + + if(!is_grout && (tiles_color_variance > 0.f || tiles_fade_variance > 0.f)) + { + float3 hsv = rgb_to_hsv(float3(tc)); + + // color variance + if(tiles_color_variance > 0.f) + { + float t = rnd*tiles_color_variance*0.25f; + + if(t < 0.f) + { + hsv.y = math::clamp(hsv.y + t, 0.f, 1.f); + } + else + { + t = math::clamp(t, 0.f, 1.f); + + hsv.y += (0.f - hsv.y)*t; + hsv.z += (0.5f - hsv.z)*t; + } + } + + // fade variance + if(tiles_fade_variance > 0.f) + { + hsv.z += rnd*tiles_fade_variance*0.5f; + if(hsv.z < 0.f) + { + hsv.z = 0.f; + } + else if(hsv.z > 1.f) + { + hsv.y -= (hsv.z -1.f); + if(hsv.y < 0.f) + hsv.y = 0.f; + hsv.z = 1.f; + } + } + + tc = color(hsv_to_rgb(hsv)); + } + + texture_return result; + result.tint = is_grout ? grout_color : tc; + result.mono = math::average(result.tint); + + return result; +} + + +// 3dsmax Tiles map for bump +export float3 ad_3dsmax_tiles_bump +( + // Coordinates + uniform int map_channel = 1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform bool U_Tile = true //it is actually an error if both mirror and tile are true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool U_Mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile = true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile"), + anno::unused(), + anno::hidden() + ]], + uniform bool V_Mirror = false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle"), + anno::unused(), + anno::hidden() + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused(), + anno::hidden() + ]], + + // Noise + uniform bool use_noise = false + [[ + anno::in_group("Noise"), + anno::display_name("Use Noise") + ]], + uniform float noise_amount = 1.f + [[ + anno::in_group("Noise"), + anno::display_name("Amount"), + anno::hard_range(0.f, 100.f), + anno::enable_if("use_noise") + ]], + uniform int noise_levels = 1 + [[ + anno::in_group("Noise"), + anno::display_name("Levels"), + anno::hard_range(1, 10), + anno::enable_if("use_noise") + ]], + uniform float noise_size = 1.f + [[ + anno::in_group("Noise"), + anno::display_name("Size"), + anno::hard_range(0.001f, 100.f), + anno::enable_if("use_noise") + ]], + uniform float noise_phase = 0.f + [[ + anno::in_group("Noise"), + anno::display_name("Phase"), + anno::hard_range(0.f, 100.f), + anno::enable_if("use_noise") + ]], + +// Standard Controls + uniform int preset_type = 5 + [[ + anno::in_group("Standard Controls"), + anno::display_name("Preset type"), + anno::hard_range(0, 7) + ]], + +// Advanced Controls + float3 tiles_color = state::normal() + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Tiles texture") + ]], + uniform float tiles_horizontal_count = 4.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Horizontal count"), + anno::hard_range(0.f, 100.f) + ]], + uniform float tiles_vertical_count = 4.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Vertical count"), + anno::hard_range(0.f, 100.f) + ]], + uniform float tiles_color_variance = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Color variance"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform float tiles_fade_variance = 0.05f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Fade variance"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + float3 grout_color = state::normal() + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Grout texture") + ]], + uniform bool grout_lock_gap_simetry = true + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Gap simetry") + ]], + uniform float grout_horizontal_gap = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Horizontal gap"), + anno::hard_range(0.f, 100.f) + ]], + uniform float grout_vertical_gap = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Vertical gap"), + anno::hard_range(0.f, 100.f), + anno::enable_if("!grout_lock_gap_simetry") + ]], + uniform float grout_percent_holes = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Percent holes"), + anno::hard_range(0.f, 100.f) + ]], + uniform float grout_rought = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Rough"), + anno::hard_range(0.f, 200.f) + ]], + uniform int random_seed = 1444 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Random seed"), + anno::hard_range(0, 65535) + ]], + uniform float line_shift = 0.5f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Line shift"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform float random_shift = 0.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Random shift"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform bool row_modify = false + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Row modify"), + anno::unused(), + anno::hidden() + ]], + uniform int per_row = 2 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Per row"), + anno::hard_range(0, 50), + anno::unused(), + anno::hidden() + ]], + uniform float per_row_change = 1.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Change"), + anno::hard_range(0.f, 5.f), + anno::unused(), + anno::hidden() + ]], + uniform bool column_modify = false + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Column modify"), + anno::unused(), + anno::hidden() + ]], + uniform int per_column = 2 + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Per column"), + anno::hard_range(0, 50), + anno::unused(), + anno::hidden() + ]], + uniform float per_column_change = 1.f + [[ + anno::in_group("Advanced Controls"), + anno::display_name("Change"), + anno::hard_range(0.f, 5.f), + anno::unused(), + anno::hidden() + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("Bump"), + anno::display_name("Bump amount"), + anno::hard_range(0.f, 1.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 uvw = state::texture_coordinate(0); + float2 uv(0.f, 0.f); + + // use noise? + if(use_noise && noise_amount > 0.f) + { + texture_return nx = base::perlin_noise_texture + ( + size: noise_size/30.f, + noise_phase: noise_phase*0.01f, + noise_levels: noise_levels, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: float3(U_Tiling), + rotation: float3(U_angle/180.f*math::PI), + translation: float3(U_Offset), + u_mirror: U_Mirror, + v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + + texture_return ny = base::perlin_noise_texture + ( + size: noise_size/30.f, + noise_phase: noise_phase*0.01f + 0.5f, + noise_levels: noise_levels, + uvw: base::transform_coordinate + ( + transform: max_rotation_translation_scale + ( + scaling: float3(V_Tiling), + rotation: float3(V_angle/180.f*math::PI), + translation: float3(V_Offset), + u_mirror: U_Mirror, + v_mirror: V_Mirror + ), + coordinate: base::coordinate_source(texture_space: map_channel-1) + ) + ); + + uv.x += nx.mono*noise_amount*0.01f; + uv.y += ny.mono*noise_amount*0.01f; + } + + if(grout_rought > 0.f) + { + base::texture_coordinate_info tci; + + tci.position *= 30.f; + tci.position.z = 1.f; + texture_return nx = base::perlin_noise_texture + ( + uvw: tci, + noise_levels: 1, + absolute_noise: true + ); + + tci.position.z = 2.f; + texture_return ny = base::perlin_noise_texture + ( + uvw: tci, + noise_levels: 1, + absolute_noise: true + ); + + uv.x += nx.mono*grout_rought*0.001f; + uv.y += ny.mono*grout_rought*0.001f; + } + + uv += float2((uvw.x - U_Offset)*U_Tiling, (uvw.y - V_Offset)*V_Tiling); + uv = float2(uv.x*tiles_horizontal_count, uv.y*tiles_vertical_count); + + bool is_grout = false; + bool odd_row; + + float du = 0.f, dv = 0.f; + + float gap_u = grout_horizontal_gap*0.01f; + float gap_v = grout_lock_gap_simetry ? gap_u : grout_vertical_gap*0.01f; + + gap_u *= tiles_horizontal_count; + gap_v *= tiles_vertical_count; + + float tile_edge_u = 0.5f*0.01f; + float tile_edge_v = 0.5f*0.01f; + + int tile_idx = random_seed; + + switch(preset_type) + { + case 1: // running bond + { + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + break; + + case 2: // common flemish bond + { + odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + if(odd_row) + { + uv.x = (uv.x + 0.25f)*0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + gap_u *= 0.5f; + tile_edge_u *= 0.5f; + + if(uv.x > 0.375f) + tile_idx *= 13; + else if(uv.x > 0.75f) + tile_idx *= 17; + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + ((uv.x - 0.375f) > -gap_u) && ((uv.x - 0.375f) <= gap_u) || + ((uv.x - 0.75f) > -gap_u) && ((uv.x - 0.75f) <= gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + else + { + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + } + break; + + case 3: // english bond + { + odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + uv.x = uv.x*2.f - 0.5f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + { + gap_u *= 2.f; + tile_edge_u *= 2.f; + } + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + } + break; + + case 4: // 1/2 running bond + { + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.25f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 5: // stack bond + { + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 6: // fine running bond + { + odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + { + uv *= 2.f; + if(math::fmod(math::floor(uv.y), 2) > 0.f) + uv.x -= 0.5f; + } + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + { + gap_u *= 2.f; + gap_v *= 2.f; + tile_edge_u *= 2.f; + tile_edge_v *= 2.f; + } + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + case 7: // fine stack bond + { + odd_row = math::fmod(math::floor(uv.y), 2) > 0.f; + + if(odd_row) + uv *= 2.f; + + tile_idx *= int(math::floor(uv.y)*tiles_vertical_count + math::floor(uv.x)); + + uv -= math::floor(uv); + + if(odd_row) + { + gap_u *= 2.f; + gap_v *= 2.f; + tile_edge_u *= 2.f; + tile_edge_v *= 2.f; + } + + is_grout = + (uv.x < gap_u) || ((1.f - uv.x) < gap_u) || + (uv.y < gap_v) || ((1.f - uv.y) < gap_v); + + } + break; + + default: // checker + is_grout = (math::frac(uv.x) < 0.5f) == (math::frac(uv.y) < 0.5f); + break; + } + + // calculate tangential vectors for tile edges. + if(!is_grout) + { + if(preset_type == 2 && odd_row) // common flemish bond + { + if(uv.x < 0.375f) + { + if(uv.x < gap_u + tile_edge_u) + du = -(uv.x - gap_u)/tile_edge_u; + else if((0.375f - uv.x) < gap_u + tile_edge_u) + du = (0.375f - uv.x + gap_u)/tile_edge_u; + } + else if (uv.x < 0.75f) + { + if((uv.x - 0.375f) < gap_u + tile_edge_u) + du = -((uv.x - 0.375f) - gap_u)/tile_edge_u; + else if((0.75f - uv.x) < gap_u + tile_edge_u) + du = (0.75f - uv.x + gap_u)/tile_edge_u; + } + else + { + if((uv.x - 0.75f) < gap_u + tile_edge_u) + du = -((uv.x - 0.75f) - gap_u)/tile_edge_u; + else if((1.f - uv.x) < gap_u + tile_edge_u) + du = (1.f - uv.x + gap_u)/tile_edge_u; + } + } + else // everything else + { + if(uv.x < gap_u + tile_edge_u) + du = -(uv.x - gap_u)/tile_edge_u; + else if((1.f - uv.x) < gap_u + tile_edge_u) + du = (1.f - uv.x + gap_u)/tile_edge_u; + } + + if(uv.y < gap_v + tile_edge_v) + dv = -(uv.y - gap_v)/tile_edge_v; + else if((1.f - uv.y) < gap_v + tile_edge_v) + dv = (1.f - uv.y + gap_v)/tile_edge_v; + } + + int tile_idx_seed = rnd_next(tile_idx); + // float rnd = (rnd_value(tile_idx_seed) - 0.5f); + + // % holes + if(!is_grout) + is_grout = rnd_value(rnd_next(tile_idx_seed)) < grout_percent_holes*0.01f; + + if(is_grout) + { + return grout_color; + } + else + { + float3 tiles_normal = + state::texture_tangent_u(0) * du + + state::texture_tangent_v(0) * dv + + tiles_color * 1.f; + + return math::normalize(math::normalize(math::lerp(state::normal(), tiles_normal, bump_amount))); + } + +} \ No newline at end of file diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/ad_3dsmax_materials.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/ad_3dsmax_materials.mdl new file mode 100644 index 0000000000000000000000000000000000000000..aaac9d18ad3be8b6d242c3ebdc7945d1690895a5 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/ad_3dsmax_materials.mdl @@ -0,0 +1,740 @@ +// Copyright 2023 NVIDIA Corporation. All rights reserved. +// +// NVIDIA CORPORATION and its licensors retain all intellectual property +// and proprietary rights in and to this software, related documentation +// and any modifications thereto. Any use, reproduction, disclosure or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA CORPORATION is strictly prohibited. + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::df::*; +import ::math::*; +import ::state::*; + +// 3dsmax Architectutal Material +export material ad_3dsmax_architectural( + float3 bumpMap = state::normal(), + float cutoutMap = 1., + color Diffuse = color(.5), + float displacementMap = 0., + uniform float ior = 1.5, + float luminance = 0., + float shininess = 1., // In the range [0..100], inverse of the roughness + float translucency = 0., + float transparency = 0. +) + = let +{ + bsdf diffuseLayer = df::diffuse_reflection_bsdf + ( + tint: Diffuse + ); + + bsdf reflectionLayer = df::simple_glossy_bsdf + ( + tint: color(1), + roughness_u: 1 - (shininess/100), + mode: df::scatter_reflect + ); + + bsdf translucentLayer = df::diffuse_transmission_bsdf + ( + tint: Diffuse + ); + + bsdf transparentLayer = df::simple_glossy_bsdf + ( + tint: color(1), + roughness_u: 0, + mode: df::scatter_transmit + ); + + bsdf transparentTranslucentMixer = df::weighted_layer + ( + weight: (translucency/100), + layer: translucentLayer, + base: transparentLayer + ); + + bsdf transparentDiffuseMixer = df::weighted_layer + ( + weight: (transparency/100), + layer: transparentTranslucentMixer, + base: diffuseLayer + ); + + bsdf glossyMixer = df::fresnel_layer + ( + ior: ior, + layer: reflectionLayer, + base: transparentDiffuseMixer + ); + + bsdf surface_bsdf = glossyMixer; +} +in material +( + ior: color(ior), + surface: material_surface + ( + scattering: surface_bsdf, + emission: material_emission + ( + emission: df::diffuse_edf(), + intensity: color(luminance), + mode: intensity_power + ) + ), + geometry: material_geometry + ( + cutout_opacity: cutoutMap, + normal: bumpMap, + displacement: displacementMap * state::normal() * state::scene_units_per_meter() + ) +); + +// 3dsmax Blend Material +export material ad_3dsmax_blend +( + material material1 = material() + [[ + anno::in_group("Blend parameters"), + anno::display_name("Material 1") + ]], + material material2 = material() + [[ + anno::in_group("Blend parameters"), + anno::display_name("Material 2") + ]], + float mixAmount = 0.f + [[ + anno::in_group("Blend parameters"), + anno::display_name("Mix amount"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool useCurve = false + [[ + anno::in_group("Blend parameters"), + anno::display_name("Use curve") + ]], + uniform float lower = 0.3f + [[ + anno::in_group("Blend parameters"), + anno::display_name("Lower"), + anno::hard_range(0.f, 1.f) + ]], + uniform float upper = .7f + [[ + anno::in_group("Blend parameters"), + anno::display_name("Upper"), + anno::hard_range(0.f, 1.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + float t = useCurve ? math::smoothstep(lower, upper, mixAmount) : math::smoothstep(0.f, 1.f, mixAmount); + float3 normal_mix = math::normalize(material1.geometry.normal*t + material2.geometry.normal*(1.f - t)); + + bsdf bsdf_mix = + df::normalized_mix + ( + components: df::bsdf_component[] + ( + df::bsdf_component + ( + weight: 1.f - t, + component: material1.surface.scattering + ), + df::bsdf_component + ( + weight: t, + component: material2.surface.scattering + ) + ) + ); +} +in material +( + ior : material1.ior, + surface : material_surface(scattering: bsdf_mix), + geometry : material_geometry + ( + normal : normal_mix + ) +); + + +// 3dsmax Double Sided Material +export material ad_3dsmax_double_sided( + material material1 = material(), + material material2 = material1 +)= material( + ior: material1.ior, + thin_walled: true, + geometry: material1.geometry, + volume: material1.volume, + surface: material1.surface, + backface: material2.surface +); + +// 3dsmax Physical Material +export material ad_3dsmax_physical_material +( + //====================================================================== + // Base Color + // + color base_color = color(.5) + [[ + anno::display_name("Color"), + anno::in_group("Base Color") + ]], + float base_weight = 1. + [[ + anno::display_name("Weight"), + anno::hard_range(0,1), + anno::in_group("Base Color") + ]], + float diff_roughness = 0. + [[ + anno::display_name("Roughness"), + anno::hard_range(0,1), + anno::in_group("Base Color") + ]], + // + //====================================================================== + + //====================================================================== + // Reflections + // + float reflectivity = 1. + [[ + anno::display_name("Reflectivity"), + anno::hard_range(0,1), + anno::in_group("Reflections") + ]], + color refl_color = color(1.) + [[ + anno::display_name("Color"), + anno::in_group("Reflections") + ]], + float roughness = 0. + [[ + anno::display_name("Roughness"), + anno::hard_range(0,1), + anno::in_group("Reflections") + ]], + uniform bool roughness_inv = false + [[ + anno::display_name("Inverse Roughness"), + anno::in_group("Reflections") + ]], + float metalness = 0. + [[ + anno::display_name("Metalness"), + anno::hard_range(0,1), + anno::in_group("Reflections") + ]], + uniform float trans_ior = 1.52 + [[ + anno::display_name("IOR"), + anno::hard_range(0.1,50), + anno::in_group("Reflections") + ]], + // + //====================================================================== + + //====================================================================== + // Transparency + // + float transparency = 0. + [[ + anno::display_name("Transparency"), + anno::hard_range(0,1), + anno::in_group("Transparency") + ]], + color trans_color = color(1.) + [[ + anno::display_name("Color"), + anno::in_group("Transparency") + ]], + float trans_depth = 1. + [[ + anno::display_name("Depth"), + anno::unused(), + anno::hidden(), + anno::in_group("Transparency") + ]], + float trans_roughness = 0. + [[ + anno::display_name("Roughness"), + anno::hard_range(0,1), + anno::in_group("Transparency") + ]], + uniform bool thin_walled = false + [[ + anno::display_name("Thin-walled"), + anno::in_group("Transparency") + ]], + uniform bool trans_roughness_inv = false + [[ + anno::display_name("Inverse Roughness"), + anno::in_group("Transparency") + ]], + uniform bool trans_roughness_lock = true + [[ + anno::display_name("Lock Roughness"), + anno::unused(), + anno::hidden(), + anno::in_group("Transparency") + ]], + // + //====================================================================== + + //====================================================================== + // Sub-surface scattering + // + uniform float scattering = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency") + ]], + uniform color sss_color = color(1.) + [[ + anno::display_name(""), + anno::in_group("Transparency") + ]], + uniform float sss_depth = 1. + [[ + anno::display_name(""), + anno::in_group("Transparency") + ]], + uniform float sss_scale = 1. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform color sss_scatter_color = color(1.) + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + // + //====================================================================== + + float anisotropy = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float anisoangle = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform float brdf_curve = 5. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform float brdf_high = 1. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform float brdf_low = 0.04 + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform bool brdf_mode = false + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float3 bump_map = state::normal() + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::hidden() + ]], + uniform float coat_affect_color = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform float coat_affect_roughness = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float3 coat_bump_map = state::normal() + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + color coat_color = color(1.) + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform float coat_ior = 1.5 + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float coat_roughness = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform bool coat_roughness_inv = false + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float coating = 1. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float cutout_map = 1. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float displacement = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + float emission = 0. + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + color emit_color = color(0.) + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]], + uniform int material_mode = 0 + [[ + anno::display_name(""), + anno::in_group("Transparency"), + anno::unused(), + anno::hidden() + ]] +) + = let +{ + //====================================================================== + // Base color + // + bsdf baseColor = df::diffuse_reflection_bsdf + ( + tint: base_color, + roughness: diff_roughness + ); + + bsdf diffuseLayer = df::weighted_layer + ( + weight: base_weight, + layer: baseColor, + base: df::diffuse_reflection_bsdf(tint:color(0)) + ); + // + //====================================================================== + + //====================================================================== + // Transparency + // + float transparencyRoughnessVal = trans_roughness_inv ? 1 - trans_roughness : trans_roughness; + + bsdf transparentLayer = df::simple_glossy_bsdf + ( + tint: trans_color, + roughness_u: transparencyRoughnessVal, + mode: df::scatter_transmit + ); + + bsdf transparentDiffuseMixer = df::weighted_layer + ( + weight: transparency, + layer: transparentLayer, + base: diffuseLayer + ); + // + //====================================================================== + + //====================================================================== + // Reflections Non Metal and Metal + // + float roughnessVal = roughness_inv ? 1 - roughness : roughness; + + bsdf reflections = df::simple_glossy_bsdf + ( + tint: refl_color, + roughness_u: roughnessVal, + mode: df::scatter_reflect + ); + + // Not reflective when roughness is 0 + // float reflectivityVal = (roughness == 0) ? 0 : reflectivity; + float reflectivityVal = reflectivity; + + bsdf reflectivity_layer = df::weighted_layer // Non-metal + ( + weight: reflectivityVal, + layer: reflections, + base: df::diffuse_reflection_bsdf(tint:color(1)) + ); + + bsdf reflectionLayerNonMetal = df::fresnel_layer + ( + ior: trans_ior, + layer: reflectivity_layer, + base: transparentDiffuseMixer + ); + + bsdf reflectionLayerMetal = df::fresnel_layer + ( + ior: trans_ior, + layer: reflectivity_layer, + base: diffuseLayer + ); + + // Metalness value. + // It mixes two shading modes. + // At 0, a non-metal diffuse model is used where the Base Color is taken as the diffuse color, with reflections added on top, with sub-surface scattering and transparency. + // At 1, a solely reflective metallic surface is rendered, reflecting the Base Color for facing angles, and the Reflection color (typically white) at the edges. + bsdf reflectionLayer = df::weighted_layer + ( + weight: metalness, + layer: reflectionLayerMetal, + base: reflectionLayerNonMetal + ); + // + //====================================================================== + + //====================================================================== + // Sub-surface scattering + // + float sss_scattering = scattering * (1 - transparency); // Ensure sss_scattering + transparency <= 1 + + material_volume materialVolume = material_volume( + scattering_coefficient: (sss_depth <= 0) ? color(0) : - math::log(color(1 - sss_scattering)) / sss_depth, + absorption_coefficient: (sss_depth <= 0) ? color(0) : - math::log(sss_color) / sss_depth + ); + // + //====================================================================== + + bsdf surface_bsdf = reflectionLayer; +} +in material +( + ior: color(trans_ior), + thin_walled: thin_walled, + surface: material_surface + ( + scattering: surface_bsdf + ), + volume: materialVolume, + geometry: material_geometry + ( + normal: bump_map + ) +); + +// 3dsmax Standard Material +export material ad_3dsmax_std_material( + color Diffuse = color(.9), + uniform bool dsLock = false + [[ + anno::unused() + ]], + color FilterColor = color(1.0) + [[ + anno::unused() + ]], + float glossiness = .9 + [[ + anno::unused() + ]], + uniform float ior = 1.5, + uniform float opacity = 1.0 + [[ + anno::unused() + ]], + uniform float opacityFallOff = 0. + [[ + anno::unused() + ]], + uniform int opacityFallOffType = 0 + [[ + anno::unused() + ]], + uniform int opacityType = 0 + [[ + anno::unused() + ]], + color selfIllumColor = color(0.) + [[ + anno::unused() + ]], + uniform float selfIllumAmount = 1. + [[ + anno::unused() + ]], + uniform int shaderType = 0 + [[ + anno::unused() + ]], + color Specular = color(1.) + [[ + anno::unused() + ]], + uniform float specularLevel = 1. + [[ + anno::unused() + ]], + float3 bump = state::normal() +) = material( + ior: color(ior), + surface: material_surface( + scattering: df::diffuse_reflection_bsdf(tint: Diffuse) + ), + geometry: material_geometry( + normal: bump + ) +); + +// 3dsmax Top/Bottom Material +export material ad_3dsmax_top_bottom +( + material top_material = material() + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Top material") + ]], + material bottom_material = top_material + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Bottom material") + ]], + uniform bool use_top_material = true + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Use top material") + ]], + uniform bool use_bottom_material = true + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Use bottom material") + ]], + uniform float blend = 0.f + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Blend"), + anno::hard_range(0.f, 100.f) + ]], + uniform float position = 50.f + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Position"), + anno::hard_range(0.f, 100.f), + anno::unused(), + anno::hidden() + ]], + uniform int coordinates = 0 + [[ + anno::in_group("Top/Bottom Parameters"), + anno::display_name("Coordinates"), + anno::hard_range(0, 1), + anno::unused(), + anno::hidden() + ]] +) += let +{ + float t = blend*0.01f; + + float3 normal_mix = math::normalize + ( + (use_top_material ? top_material.geometry.normal : state::normal())*t + + (use_bottom_material ? bottom_material.geometry.normal : state::normal())*(1.f - t) + ); + + bsdf bsdf_mix = + df::normalized_mix + ( + components: df::bsdf_component[] + ( + df::bsdf_component + ( + weight: 1.f - t, + component: use_top_material ? top_material.surface.scattering : bsdf() + ), + df::bsdf_component + ( + weight: t, + component: use_bottom_material ? bottom_material.surface.scattering : bsdf() + ) + ) + ); +} +in material +( + ior : use_top_material ? top_material.ior : color(1.f), + surface : material_surface(scattering: bsdf_mix), + geometry : material_geometry + ( + normal : normal_mix + ) +); + diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/vray_maps.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/vray_maps.mdl new file mode 100644 index 0000000000000000000000000000000000000000..bb998de737e52ead3f83feae53df9cf6a2f1a2cc --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/vray_maps.mdl @@ -0,0 +1,943 @@ +// Copyright 2023 NVIDIA Corporation. All rights reserved. +// +// NVIDIA CORPORATION and its licensors retain all intellectual property +// and proprietary rights in and to this software, related documentation +// and any modifications thereto. Any use, reproduction, disclosure or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA CORPORATION is strictly prohibited. + +mdl 1.6; + +import ::anno::*; +import ::base::*; +import ::math::*; +import ::state::*; +import ::tex::*; + +export using ::base import texture_return; + +// Returns the normal n in tangent space, given n is in internal space. +float3 transform_internal_to_tangent(float3 n) +{ + 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); +} + +// 3dsmax Bitmap Transformation Matrix +uniform float4x4 max_rotation_translation_scale +( + uniform float3 rotation = float3(0.) + [[ anno::description("Rotation applied to every UVW coordinate") ]], + uniform float3 translation = float3(0.) + [[ anno::description("Offset applied to every UVW coordinate") ]], + uniform float3 scaling = float3(1.) + [[ anno::description("Scale applied to every UVW coordinate") ]], + uniform bool u_mirror = false + [[ anno::description("Mirror repeat has twice the number of textures in the same space") ]], + uniform bool v_mirror = false + [[ anno::description("Mirror repeat has twice the number of textures in the same space") ]] +) +[[ + anno::description("Construct transformation matrix from Euler rotation, translation and scale") +]] +{ + float4x4 scale = + float4x4(u_mirror?scaling.x*2.:scaling.x , 0. , 0. , 0., + 0. , v_mirror?scaling.y*2.:scaling.y , 0. , 0., + 0. , 0. , scaling.z , 0., + u_mirror?1.:.5 , v_mirror?1.:.5 , .5 , 1.); + + float4x4 translate = + float4x4(1. , 0. , 0. , 0., + 0. , 1. , 0. , 0., + 0. , 0. , 1. , 0., + -0.5-translation.x, -0.5-translation.y, -0.5-translation.z, 1.); + + + // Euler rotation matrix xyz order + float3 s = math::sin(rotation); + float3 c = math::cos(rotation); + float4x4 rotate = + float4x4( c.y*c.z , c.y*s.z , -s.y , 0.0, + -c.x*s.z + s.x*s.y*c.z, c.x*c.z + s.x*s.y*s.z , s.x*c.y , 0.0, + s.x*s.z + c.x*s.y*c.z , -s.x*c.z + c.x*s.y*s.z, c.x*c.y , 0.0, + 0. , 0. , 0. , 1.); + return scale *rotate*translate; +} + +export enum vray_color_mode +[[ + anno::hidden() +]] +{ + mode_color, + mode_temperature +}; + +export enum vray_color_primaries +[[ + anno::hidden() +]] +{ + primaries_none, + primaries_sRGB, + primaries_ACEScg +}; + +export enum vray_bitmap_primaries +[[ + anno::hidden() +]] +{ + bm_primaries_default, + bm_primaries_sRGB, + bm_primaries_ACEScg, + bm_primaries_raw +}; + +export enum vray_rgb_output +[[ + anno::hidden() +]] +{ + rgb_output_rgb_color, + rgb_output_alpha_as_grey, + rgb_output_intensity_as_grey +}; + +export enum vray_mono_output +[[ + anno::hidden() +]] +{ + mono_output_rgb_intensity, + mono_output_alpha +}; + +export enum vray_alpha_source +[[ + anno::hidden() +]] +{ + alpha_source_image_alpha, + alpha_source_intensity, + alpha_source_opaque +}; + +// VRayBitmap map +export texture_return VRayBitmap +( + // UVW Coordinates + uniform int mapChannel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform bool U_Tile=true //it is actually an error if both mirror and tile are true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile") + ]], + uniform bool U_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile") + ]], + uniform bool V_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle") + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused(), + anno::hidden() + ]], + + // Bitmap + uniform texture_2d filename = texture_2d() + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bitmap") + ]], + uniform float multiplier = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Overall multiplier") + ]], + uniform vray_rgb_output rgb_output = rgb_output_rgb_color + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("RGB output") + ]], + uniform vray_mono_output mono_output = mono_output_rgb_intensity + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Mono output") + ]], + uniform vray_alpha_source alpha_source = alpha_source_image_alpha + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Alpha source") + ]], + uniform vray_bitmap_primaries rgb_primaries = bm_primaries_raw + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("RGB primaries"), + anno::unused(), + anno::hidden() + ]], + uniform bool crop_enable = false + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Crop") + ]], + uniform float crop_u = 0.f //u+w and v+h are always <=1.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("U Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_w = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("W Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_v = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("V Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_h = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("H Crop"), + anno::hard_range(0.f, 1.f) + ]], + + // Output + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump amount"), + anno::unused(), + anno::hidden() + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused(), + anno::hidden() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB intensity"), + anno::unused(), + anno::hidden() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output amount") + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB level") + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + uniform float clip_u = crop_enable ? crop_u : 0.f; + uniform float clip_w = crop_enable ? crop_w : 1.f; + uniform float clip_v = crop_enable ? crop_v : 0.f; + uniform float clip_h = crop_enable ? crop_h : 1.f; + + texture_return bitmap_sample = base::file_texture + ( + texture : filename, + mono_source : (alpha_source == alpha_source_image_alpha) ? base::mono_alpha : base::mono_average, + crop_u : float2(clip_u, clip_w + clip_u), + crop_v : float2(1.f - clip_v - clip_h, 1.f - clip_v), + uvw : base::transform_coordinate + ( + transform : max_rotation_translation_scale + ( + scaling : float3(U_Tiling, V_Tiling, 1.f), + rotation : float3(U_angle, V_angle, W_angle)/180.f*math::PI , + translation : float3(U_Offset, V_Offset, 0.f), u_mirror : U_Mirror, v_mirror : V_Mirror + ), + coordinate : base::coordinate_source(texture_space: mapChannel-1) + ), + wrap_u : U_Tile ? tex::wrap_repeat : U_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + wrap_v : V_Tile ? tex::wrap_repeat : V_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip + ); + + bitmap_sample.tint = invert ? + bitmap_sample.tint * (-rgb_level * output_amount * multiplier ) + (1.f - rgb_offset) : + bitmap_sample.tint * (rgb_level * output_amount * multiplier) + rgb_offset; + + float alpha = (alpha_source != alpha_source_opaque) ? bitmap_sample.mono : 1.f; + bitmap_sample.tint = bitmap_sample.tint*alpha; + + // determinate mono output + if(mono_output == mono_output_alpha) + bitmap_sample.mono = alpha; + else + bitmap_sample.mono = math::average(bitmap_sample.tint); + + // determinate rgb output + if(rgb_output == rgb_output_alpha_as_grey) + bitmap_sample.tint = color(alpha); + else if(rgb_output == rgb_output_intensity_as_grey) + bitmap_sample.tint = color(math::average(bitmap_sample.tint)); + + return bitmap_sample; +} +// VRayBitmap Map for Bump +export float3 VRayBitmap_bump +( + // UVW Coordinates + uniform int mapChannel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel") + ]], + uniform bool U_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tile") + ]], + uniform bool U_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("U Mirror") + ]], + uniform bool V_Tile=true + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tile") + ]], + uniform bool V_Mirror=false + [[ + anno::in_group("Coordinates"), + anno::display_name("V Mirror") + ]], + uniform float U_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Angle") + ]], + uniform float V_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Angle") + ]], + uniform float W_angle = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("W Angle") + ]], + uniform float U_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Offset") + ]], + uniform float V_Offset = 0.f + [[ + anno::in_group("Coordinates"), + anno::display_name("V Offset") + ]], + uniform float U_Tiling = 1.f + [[ + anno::in_group("Coordinates"), + anno::display_name("U Tiling") + ]], + uniform float V_Tiling = 1. + [[ + anno::in_group("Coordinates"), + anno::display_name("V Tiling") + ]], + uniform int UVW_Type = 0 //enum? + [[ + anno::in_group("Coordinates"), + anno::display_name("UVW Type"), + anno::unused() + ]], + + // Bitmap + uniform texture_2d filename = texture_2d() + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bitmap") + ]], + uniform bool crop_enable = false + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Crop") + ]], + uniform float crop_u = 0.f //u+w and v+h are always <=1.0 + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("U Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_w = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("W Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_v = 0.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("V Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float crop_h = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("H Crop"), + anno::hard_range(0.f, 1.f) + ]], + uniform float factor = 1.f + [[ + anno::in_group("Bitmap parameters"), + anno::display_name("Bump amount") + ]], + + // Output + uniform float bump_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Bump output") + ]], + uniform bool clamp = false + [[ + anno::in_group("Output"), + anno::display_name("Clamp"), + anno::unused() + ]], + uniform bool invert = false + [[ + anno::in_group("Output"), + anno::display_name("Invert") + ]], + uniform bool alphaFromRGB = false + [[ + anno::in_group("Output"), + anno::display_name("Alpha from RGB intensity"), + anno::unused() + ]], + uniform float output_amount = 1.f + [[ + anno::in_group("Output"), + anno::display_name("Output amount"), + anno::unused() + ]], + uniform float rgb_level = 1.f + [[ + anno::in_group("Output"), + anno::display_name("RGB level"), + anno::unused() + ]], + uniform float rgb_offset = 0.f + [[ + anno::in_group("Output"), + anno::display_name("RGB Offset"), + anno::unused() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + uniform float clip_u = crop_enable ? crop_u : 0.f; + uniform float clip_w = crop_enable ? crop_w : 1.f; + uniform float clip_v = crop_enable ? crop_v : 0.f; + uniform float clip_h = crop_enable ? crop_h : 1.f; + + return base::file_bump_texture + ( + texture : filename, + crop_u : float2(clip_u, clip_w + clip_u), + crop_v : float2(1.f - clip_v - clip_h, 1.f - clip_v), + uvw : base::transform_coordinate + ( + transform : max_rotation_translation_scale + ( + scaling : float3(U_Tiling, V_Tiling, 1.f), + rotation : float3(U_angle, V_angle,W_angle)/(180.*math::PI), + translation : float3(U_Offset, V_Offset, 0.f), u_mirror : U_Mirror, v_mirror : V_Mirror + ), + coordinate : base::coordinate_source(texture_space: mapChannel - 1) + ), + wrap_u : U_Tile ? tex::wrap_repeat : U_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + wrap_v : V_Tile ? tex::wrap_repeat : V_Mirror ? tex::wrap_mirrored_repeat : tex::wrap_clip, + factor : invert ? -10.f*factor*bump_amount : 10.f*factor*bump_amount + ); +} + +// VRayBump2Normal Map for Bump +export enum vray_bump2normal_mode +[[ + anno::hidden() +]] +{ + b2n_tangent_space, + b2n_local_XYZ, + b2n_screen_space, + b2n_world_space +}; + +export texture_return VRayBump2Normal +( + float3 bump_map = state::normal() + [[ + anno::in_group("Parameters"), + anno::display_name("Bump map") + ]], + uniform float bump_map_mult = 100.f + [[ + anno::in_group("Parameters"), + anno::display_name("Bump map multiplier"), + anno::hard_range(0.f, 100.f) + ]], + uniform vray_bump2normal_mode mode = b2n_tangent_space + [[ + anno::in_group("Parameters"), + anno::display_name("Mode"), + anno::unused(), + anno::hidden() + ]], + uniform int map_channel=1 + [[ + anno::in_group("Coordinates"), + anno::display_name("Map channel"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + texture_return normal_tex; + + float3 normal_tangent_space = + transform_internal_to_tangent(math::normalize(state::normal() + (bump_map - state::normal())*(bump_map_mult*0.01f))); + + normal_tex.tint = color( (normal_tangent_space + float3(1.f))*0.5f ); + normal_tex.mono = 1.f; + return normal_tex; +} + +// VRayColor Map +export texture_return VRayColor +( + uniform vray_color_mode color_mode = mode_color + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Color mode") + ]], + uniform float temperature = 6500.f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Temperature"), + anno::hard_range(350.f, 1000000000.f) + ]], + uniform float red = 0.5f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Red"), + anno::soft_range(0.f, 1.f) + ]], + uniform float green = 0.5f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Green"), + anno::soft_range(0.f, 1.f) + ]], + uniform float blue = 0.5f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Blue"), + anno::soft_range(0.f, 1.f) + ]], + uniform float rgb_multiplier = 1.f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("RGB Multiplier") + ]], + uniform float alpha = 1.f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Alpha"), + anno::hard_range(0.f, 1.f) + ]], + uniform float color_gamma = 1.0f + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("Color gamma"), + anno::hard_range(0.05f, 20.f) + ]], + uniform vray_color_primaries rgb_primaries = primaries_none + [[ + anno::in_group("VRayColor Parameters"), + anno::display_name("RGB primaries"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 rgb(red, green, blue); + + // using temperature?. Then convert from Kelvin to RGB + if(color_mode == mode_temperature) + { + float k = temperature*0.01f; + + // red + if (temperature < 6600.f) + { + rgb.x = 1.f; + } + else + { + float r = k - 55.f; + r = (351.9769f + 0.1142f * r - 40.2537f * math::log(r))/255.f; + rgb.x = math::clamp(r, 0.f, 1.f); + } + + // green + if (temperature < 6600.f) + { + float g = k - 2.f; + g = (-155.2549f - 0.4460f * g + 104.4922f * math::log(g))/255.f; + rgb.y = math::clamp(g, 0.f, 1.f); + + } + else + { + float g = k - 50.f; + g = (325.4494f + 0.0794f * g - 28.0853f * math::log(g))/255.f; + rgb.y = math::clamp(g, 0.f, 1.f); + } + + // blue + if (temperature >= 6600.f) + { + rgb.z = 1.f; + } + else if (temperature <= 2000.f) + { + rgb.z = 0.f; + } + else + { + float b = k - 10.f; + b = (-254.7694f + 0.8274f * blue + 115.6799f * math::log(b))/255.f; + rgb.z = math::clamp(b, 0.f, 1.f); + } + } + + // apply gamma + if(color_gamma != 1.f) + rgb = math::pow(rgb, 1.f/color_gamma); + + // apply multiplier + rgb *= rgb_multiplier; + + // fix ranges and return + rgb = math::clamp(rgb, 0.f, 1.f); + return texture_return(color(rgb), alpha); +} + +// VRayColor Map for Bump +export float3 VRayColor_bump +( +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return state::normal(); +} + +// VRayColor2Bump Map for Bump +export float3 VRayColor2Bump_bump +( + float3 map = state::normal() + [[ + anno::in_group("Parameters"), + anno::display_name("Bump map") + ]], + uniform float height = 2.0f + [[ + anno::in_group("Parameters"), + anno::display_name("Height"), + anno::unused(), + anno::hidden() + ]], + uniform float bump_delta_scale = 1.0f + [[ + anno::in_group("Parameters"), + anno::display_name("Bump delta scale"), + anno::unused(), + anno::hidden(), + anno::hard_range(0.f, 1.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return map; +} + +// VRay Dirt Map +export texture_return VRayDirt +( + float radius = 10.f + [[ + anno::in_group("VRayDirt Parameters"), + anno::display_name("Radius"), + anno::unused(), + anno::hidden() + ]], + color occluded_color = color(0.f) + [[ + anno::in_group("VRayDirt Parameters"), + anno::display_name("Occluded color"), + anno::unused(), + anno::hidden() + ]], + color unoccluded_color = color(1.f) + [[ + anno::in_group("VRayDirt Parameters"), + anno::display_name("Unoccluded color") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return texture_return(unoccluded_color, 1.f); +} + +// VRay Edges Tex Map +export texture_return VRayEdgesTex +( + color edges_color = color(1.f) + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Color") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return texture_return(edges_color, 1.f); +} + +// VRay Edges Tex Map for bump +export float3 VRayEdgesTex_bump +( + color edges_color = color(1.f) + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Color"), + anno::unused(), + anno::hidden() + ]], + uniform float radius = 0.1f + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Radius"), + anno::hard_range(0.f, 100.f) + + ]], + uniform bool same_object_only = true + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Consider same object only") + ]], + uniform int corners_mode = 0 + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Corners"), + anno::unused(), + anno::hidden() + ]], + float multiplier = 1.f + [[ + anno::in_group("VRayEdgesTex params"), + anno::display_name("Multiplier"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + return state::rounded_corner_normal(radius*state::meters_per_scene_unit(), !same_object_only); +} + +// VRay Normap Map for bump +export float3 VRayNormalMap_bump +( + texture_return normal_map = texture_return() + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Normal map") + ]], + float3 bump_map = state::normal() + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Bump map") + ]], + uniform float normal_amount = 1.f + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Normal amount"), + anno::hard_range(-1000.f, 1000.f) + ]], + uniform float bump_amount = 1.f + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Bump amount"), + anno::hard_range(-1000.f, 1000.f) + ]], + uniform bool flip_red = false + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Flip red") + ]], + uniform bool flip_green = false + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Flip green") + ]], + uniform bool swap_rg = false + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Swap red and green") + ]], + uniform int map_channel = 1 + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Map channel"), + anno::hidden(), + anno::unused() + ]], + uniform float map_rotation = 0.f + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Map rotation"), + anno::hard_range(0.f, 360.f), + anno::hidden(), + anno::unused() + ]], + uniform float normal_map_amount = 1.0f + [[ + anno::in_group("VRayNormalMap Parameters"), + anno::display_name("Map amount"), + anno::hard_range(-10.f, 10.f) + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] +{ + float3 tangent_space_normal = float3(normal_map.tint); + + if(flip_red) + tangent_space_normal.x = 1.f - tangent_space_normal.x; + + if(flip_green) + tangent_space_normal.y = 1.f - tangent_space_normal.y; + + if(swap_rg) + { + float tmp = tangent_space_normal.x; + tangent_space_normal.x = tangent_space_normal.y; + tangent_space_normal.y = tmp; + } + + float normal_factor = normal_amount*(normal_map_amount); + tangent_space_normal = (tangent_space_normal - float3(0.5f))*(2.f*normal_factor); + + float3 mapped_normal = math::normalize( + state::texture_tangent_u(0) * tangent_space_normal.x + + state::texture_tangent_v(0) * tangent_space_normal.y + + state::normal() * (tangent_space_normal.z + (1.f - normal_factor))); + + float3 bumped_normal = math::normalize(math::lerp(state::normal(), bump_map, bump_amount*normal_map_amount)); + + return math::normalize(mapped_normal + bumped_normal); +} diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/vray_materials.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/vray_materials.mdl new file mode 100644 index 0000000000000000000000000000000000000000..675352a72d64f7202b476d08e87ac34f5e8f34b6 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/templates/vray_materials.mdl @@ -0,0 +1,1723 @@ +// Copyright 2023 NVIDIA Corporation. All rights reserved. +// +// NVIDIA CORPORATION and its licensors retain all intellectual property +// and proprietary rights in and to this software, related documentation +// and any modifications thereto. Any use, reproduction, disclosure or +// distribution of this software and related documentation without an express +// license agreement from NVIDIA CORPORATION is strictly prohibited. + +mdl 1.6; + +import ::anno::*; +import ::df::*; +import ::df::color_weighted_layer; +import ::math::*; +import ::state::*; + +// VRay 2-Sided Material +export material VRay2SidedMtl +( + material frontMtl = material() + [[ + anno::in_group("Parameters"), + anno::display_name("Front material") + ]], + material backMtl = frontMtl + [[ + anno::in_group("Parameters"), + anno::display_name("Back material") + ]], + uniform bool use_backMtl = false + [[ + anno::in_group("Parameters"), + anno::display_name("Use back material") + ]], + color translucency = color(.5f) + [[ + anno::in_group("Basic parameters"), + anno::display_name("Translucency") + ]], + color front_tint = color(1.f) + [[ + anno::in_group("Parameters"), + anno::display_name("Front tint"), + anno::hidden() + ]], + color back_tint = color(1.f) + [[ + anno::in_group("Parameters"), + anno::display_name("Back tint"), + anno::hidden() + ]], + uniform bool multiply_by_front_diffuse = false + [[ + anno::in_group("Basic parameters"), + anno::display_name("Multiply by front diffuse"), + anno::unused(), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + bsdf transmission_bsdf = + df::diffuse_transmission_bsdf(tint: (front_tint + back_tint)*0.5f); + + + bsdf front_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : frontMtl.surface.scattering + ); + + bsdf back_bsdf = + df::color_weighted_layer + ( + weight : translucency, + layer : transmission_bsdf, + base : backMtl.surface.scattering + ); + +} +in material +( + ior: frontMtl.ior, + thin_walled: true, + geometry: frontMtl.geometry, + volume: frontMtl.volume, + surface: material_surface(scattering: front_bsdf), + backface: material_surface(scattering: use_backMtl ? back_bsdf : front_bsdf) +); + +// VRay Blend - Default clear material for unused coat slots +export material clear_material() += material +( + ior : color(1.0), + surface : material_surface(df::specular_bsdf(mode: df::scatter_transmit)), + geometry: material_geometry(cutout_opacity: 0.0) +); + +// VRay Blend Material +export material VRayBlendMtl( + material base_mtl = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("Base material") + ]], + + uniform bool enabled1 = false + [[ + anno::in_group("Parameters"), + anno::display_name("1: Enable") + ]], + material coat_mtl1 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("1: Coat material") + ]], + color blend_amount1 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("1: Blend amount") + ]], + + uniform bool enabled2 = false + [[ + anno::in_group("Parameters"), + anno::display_name("2: Enable") + ]], + material coat_mtl2 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("2: Coat material") + ]], + color blend_amount2 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("2: Blend amount") + ]], + + uniform bool enabled3 = false + [[ + anno::in_group("Parameters"), + anno::display_name("3: Enable") + ]], + material coat_mtl3 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("3: Coat material") + ]], + color blend_amount3 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("3: Blend amount") + ]], + + uniform bool enabled4 = false + [[ + anno::in_group("Parameters"), + anno::display_name("4: Enable") + ]], + material coat_mtl4 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("4: Coat material") + ]], + color blend_amount4 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("4: Blend amount") + ]], + + uniform bool enabled5 = false + [[ + anno::in_group("Parameters"), + anno::display_name("5: Enable") + ]], + material coat_mtl5 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("5: Coat material") + ]], + color blend_amount5 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("5: Blend amount") + ]], + + uniform bool enabled6 = false + [[ + anno::in_group("Parameters"), + anno::display_name("6: Enable") + ]], + material coat_mtl6 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("6: Coat material") + ]], + color blend_amount6 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("6: Blend amount") + ]], + + uniform bool enabled7 = false + [[ + anno::in_group("Parameters"), + anno::display_name("7: Enable") + ]], + material coat_mtl7 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("7: Coat material") + ]], + color blend_amount7 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("7: Blend amount") + ]], + + uniform bool enabled8 = false + [[ + anno::in_group("Parameters"), + anno::display_name("8: Enable") + ]], + material coat_mtl8 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("8: Coat material") + ]], + color blend_amount8 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("8: Blend amount") + ]], + + uniform bool enabled9 = false + [[ + anno::in_group("Parameters"), + anno::display_name("9: Enable") + ]], + material coat_mtl9 = clear_material() + [[ + anno::in_group("Parameters"), + anno::display_name("9: Coat material") + ]], + color blend_amount9 = color(.5) + [[ + anno::in_group("Parameters"), + anno::display_name("9: Blend amount") + ]], + + uniform bool additive = false + [[ + anno::in_group("Parameters"), + anno::display_name("Additive mode") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + color white(1.0); + color black(0.0); + + bsdf additive_bsdf = + df::color_normalized_mix + ( + components: df::color_bsdf_component[] + ( + df::color_bsdf_component + ( + weight: white, + component: base_mtl.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled1 ? blend_amount1 * coat_mtl1.geometry.cutout_opacity : black, + component: coat_mtl1.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled2 ? blend_amount2 * coat_mtl2.geometry.cutout_opacity : black, + component: coat_mtl2.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled3 ? blend_amount3 * coat_mtl3.geometry.cutout_opacity : black, + component: coat_mtl3.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled4 ? blend_amount4 * coat_mtl4.geometry.cutout_opacity : black, + component: coat_mtl4.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled5 ? blend_amount5 * coat_mtl5.geometry.cutout_opacity : black, + component: coat_mtl5.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled6 ? blend_amount6 * coat_mtl6.geometry.cutout_opacity : black, + component: coat_mtl6.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled7 ? blend_amount7 * coat_mtl7.geometry.cutout_opacity : black, + component: coat_mtl7.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled8 ? blend_amount8 * coat_mtl8.geometry.cutout_opacity : black, + component: coat_mtl8.surface.scattering + ), + df::color_bsdf_component + ( + weight: enabled9 ? blend_amount9 * coat_mtl9.geometry.cutout_opacity : black, + component: coat_mtl9.surface.scattering + ) + ) + ); + + bsdf blend_bsdf = + df::color_weighted_layer + ( + weight: enabled9 ? blend_amount9 * coat_mtl9.geometry.cutout_opacity : black, + layer: coat_mtl9.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled8 ? blend_amount8 * coat_mtl8.geometry.cutout_opacity : black, + layer: coat_mtl8.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled7 ? blend_amount7 * coat_mtl7.geometry.cutout_opacity : black, + layer: coat_mtl7.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled6 ? blend_amount6 * coat_mtl6.geometry.cutout_opacity : black, + layer: coat_mtl6.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled5 ? blend_amount5 * coat_mtl5.geometry.cutout_opacity : black, + layer: coat_mtl5.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled4 ? blend_amount4 * coat_mtl4.geometry.cutout_opacity : black, + layer: coat_mtl4.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled3 ? blend_amount3 * coat_mtl3.geometry.cutout_opacity : black, + layer: coat_mtl3.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled2 ? blend_amount2 * coat_mtl2.geometry.cutout_opacity : black, + layer: coat_mtl2.surface.scattering, + base: df::color_weighted_layer + ( + weight: enabled1 ? blend_amount1 * coat_mtl1.geometry.cutout_opacity : black, + layer: coat_mtl1.surface.scattering, + base: base_mtl.surface.scattering + ) + ) + ) + ) + ) + ) + ) + ) + ); + + bsdf surface_bsdf = additive ? additive_bsdf : blend_bsdf; + +} in material +( + ior : base_mtl.ior, + surface : material_surface(scattering: surface_bsdf) +); + +// VRay Car Paint + +// constants for numerical fitted curve to observed flake noise density behavior +// 1. no jitter, maximum flake diameter +const float4 ABCD = float4(-26.19771808f, 26.39663835f, 85.53857017f, -102.35069432f); +const float2 EF = float2(-101.42634862f, 118.45082288f); +// 2. jitter scale of 0.5f, maximum flake diameter +const float4 ABCD_J = float4(-0.87962159f, 0.91006603f, 0.76088203f, -0.24953308f); +const float2 EF_J = float2(-3.11456809f, 2.63430594f); + +// +// flake noise utilities +// +int hash(int seed, int i) +{ + return (i ^ seed) * 1075385539; +} + +int rnd_init(int3 pos) +{ + return hash(hash(hash(0, pos.x), pos.y), pos.z); +} + +int rnd_next(int seed) +{ + // xorshift32 using signed int + seed ^= seed << 13; + seed ^= seed >>> 17; + seed ^= seed << 5; + return seed; +} + +float rnd_value(int seed) +{ + return math::abs(float(seed) * 4.6566e-10f); +} + +struct flake_noise_value +{ + // flake priority (in [0..1], 0: no flake, flakes with higher priority shadow flakes "below" them) + float priority; + + // current pseudo random number generator seed + int rnd_seed; +}; + +// apply random rotation (using "Fast Random Rotation Matrices" by James Arvo) +float3 rotate_pos(float3 pos, float3 xi) +{ + float theta = math::PI * 2.0f * xi.x; + float phi = math::PI * 2.0f * xi.y; + float z = xi.z * 2.0f; + + float r = math::sqrt(z); + float[2] sp_cp = math::sincos(phi); + float Vx = sp_cp[0] * r; + float Vy = sp_cp[1] * r; + float Vz = math::sqrt(2.0f - z); + + float[2] st_ct = math::sincos(theta); + float Sx = Vx * st_ct[1] - Vy * st_ct[0]; + float Sy = Vx * st_ct[0] + Vy * st_ct[1]; + + float3x3 M( + Vx * Sx - st_ct[1], Vx * Sy - st_ct[0], Vx * Vz, + Vy * Sx + st_ct[0], Vy * Sy - st_ct[1], Vy * Vz, + Vz * Sx, Vz * Sy, 1.0f - z); + + return M * pos; +} + +// create a flake normal by importance sampling the Beckmann distribution with given roughness +float3 flake_normal +( + flake_noise_value val, + float spread +) +{ + if (val.priority <= 0.0f) + return state::normal(); + + int seed0 = rnd_next(val.rnd_seed); + float xi0 = rnd_value(seed0); + float xi1 = rnd_value(rnd_next(seed0)); + + float phi = math::PI * 2.0f * xi0; + + float roughness = spread * spread; + + float tantheta = math::sqrt(-roughness * roughness * math::log(1.0f - xi1)); + float sintheta = tantheta / math::sqrt(1.0f + tantheta * tantheta); + float costheta = math::sqrt(1.0f - sintheta * sintheta); + + float[2] scphi = math::sincos(phi); + return + state::texture_tangent_u(0) * scphi[1] * sintheta + + state::texture_tangent_v(0) * scphi[0] * sintheta + + state::normal() * costheta; +} + +// compute a flake probability for a given flake coverage density x +float density_to_probability +( + float4 abcd, + float2 ef, + float x +) +{ + float xx = x * x; + return (abcd.x * xx + abcd.y * x) / (abcd.z * xx * x + abcd.w * xx + ef.x * x + ef.y); +} + +// Flake noise function with controllable regularity, flake size, and probability +flake_noise_value flake_noise +( + float3 pos, + float jitter_scale = 1.0f, + float flake_diameter = 0.75f, + float flake_probability = 1.0f, + int seed_offset = 1 +) +{ + float3 base_pos = math::floor(pos); + int3 base_pos_i = int3(base_pos); + + // limit the flake size to the allowed maximum (such that looking at all neighbors is sufficient) + flake_diameter = math::min(flake_diameter, (3.f - 0.5f * jitter_scale) / math::sqrt(3.0f)); + + flake_noise_value val(0.0f, 0); + + for (int i = -1; i < 2; ++i) + { + for (int j = -1; j < 2; ++j) + { + for (int k = -1; k < 2; ++k) + { + int seed = rnd_init((base_pos_i + int3(i, j, k)) + seed_offset); + + seed = rnd_next(seed); + if (rnd_value(seed) > flake_probability) + continue; + + seed = rnd_next(seed); + float priority = rnd_value(seed); + if (priority < val.priority) + continue; + + float3 flake_pos = base_pos + float3(i, j, k) + float3(0.5f); + + if (jitter_scale > 0.0f) + { + seed = rnd_next(seed); + flake_pos.x += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.y += (rnd_value(seed) - 0.5f) * jitter_scale; + seed = rnd_next(seed); + flake_pos.z += (rnd_value(seed) - 0.5f) * jitter_scale; + } + + float3 p = pos - flake_pos; + if (math::dot(p, p) >= flake_diameter * flake_diameter * 4.0f) + continue; + + float3 xi_rot; + seed = rnd_next(seed); + xi_rot.x = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.y = rnd_value(seed); + seed = rnd_next(seed); + xi_rot.z = rnd_value(seed); + p = rotate_pos(p, xi_rot); + + if (math::abs(p.x) <= flake_diameter && + math::abs(p.y) <= flake_diameter && + math::abs(p.z) <= flake_diameter) + { + val.priority = priority; + val.rnd_seed = seed; + } + } + } + } + + return val; +} + +// Statistically controlled (area/volume coverage density) flake noise +flake_noise_value flake_noise +( + float3 position, + float diameter, + float density = 0.5f, + int seed_offset = 1, + bool jittered = false +) +{ + float probability = density_to_probability(jittered ? ABCD_J : ABCD, jittered ? EF_J : EF, density); + + return flake_noise + ( + pos : position, + jitter_scale : jittered ? 0.5f : 0.0f, + flake_diameter : (jittered ? 2.5f*diameter : 3.0f*diameter) / math::sqrt(3.0f), + flake_probability : probability, + seed_offset : seed_offset + ); +} + +export material VRayCarPaintMtl +( + // Base layer + color base_color = color(0.3f, 0.4f, 0.5f) + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base color") + ]], + float base_reflection = 0.5f + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base reflection"), + anno::hard_range(0.f, 1.f) + ]], + float base_glossiness = 0.6f + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool base_trace_reflections = true + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base trace reflections"), + anno::unused(), + anno::hidden() + ]], + + // Flake layer + color flake_color = color(0.3f, 0.4f, 0.8f) + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake color") + ]], + float flake_glossiness = 0.8f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake glossiness"), + anno::hard_range(0.f, 1.f) + ]], + float flake_orientation = 0.3f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake orientation"), + anno::hard_range(0.f, 1.f) + ]], + uniform float flake_density = 0.5f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake density"), + anno::hard_range(0.f, 4.f) + ]], + uniform float flake_scale = 0.01f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake scale"), + anno::hard_range(0.f, 1.0e10f) + ]], + uniform float flake_size = 0.5f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake size"), + anno::hard_range(0.f, 1.0e10f) + ]], + uniform int flake_seed = 1 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake seed"), + anno::hard_range(1, 65535) + ]], + uniform int flake_filtering = 1 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake filtering"), + anno::unused(), + anno::hidden() + ]], + uniform int flake_map_size = 1024 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake map size"), + anno::unused(), + anno::hidden() + ]], + uniform int flake_mapping_type = 0 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake mapping type") + ]], + uniform int flake_map_channel = 1 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake map channel") + ]], + uniform bool flake_trace_reflections = true + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake trace reflections"), + anno::unused(), + anno::hidden() + ]], + + + // Coat layer + color coat_color = color(1.0f) + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat color") + ]], + float coat_strength = 0.05f + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat strength"), + anno::hard_range(0.f, 1.f) + ]], + float coat_glossiness = 1.0f + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool coat_trace_reflections = true + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat trace reflections"), + anno::unused(), + anno::hidden() + ]], + + // Options + uniform bool double_sided = true + [[ + anno::in_group("Options"), + anno::display_name("Double sided") + ]], + + // Maps + float3 base_bump_map = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float3 coat_bump_map = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Coat Map") + ]], + + float displacement_map = 0.f + [[ + anno::in_group("Maps"), + anno::display_name("Displacement map") + ]] + +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + // sample flake distribution + flake_noise_value val = (flake_mapping_type == 1) ? + flake_noise(state::position() / flake_scale, flake_size*0.5f, flake_density/8.f, flake_seed, true) : + flake_noise(state::texture_coordinate(flake_map_channel - 1) / flake_scale, flake_size*0.5f, flake_density/2.f, flake_seed, true); + + bool is_flake = (flake_mapping_type == 1) ? + flake_density/8.f >= 1.0f || val.priority > 0.0f : + flake_density/2.f >= 1.0f || val.priority > 0.0f; + + // Base layer BSDF + bsdf base_bsdf = + df::fresnel_layer + ( + ior : 1.5f, + weight : base_reflection, + layer : df::microfacet_ggx_smith_bsdf + ( + roughness_u : (1.f - base_glossiness)*(1.f - base_glossiness) + ), + base : df::diffuse_reflection_bsdf + ( + tint : base_color + ), + normal : base_bump_map + ); + + // Flakes BSDF + bsdf flake_bsdf = + df::microfacet_ggx_smith_bsdf + ( + tint : flake_color, + roughness_u : (1.f - flake_glossiness)*(1.f - flake_glossiness) + ); + + bsdf surface_bsdf = + df::weighted_layer + ( + weight : is_flake ? 1.0f : 0.0f, + normal : flake_normal(val, flake_orientation*0.5f), + layer : flake_bsdf, + base : base_bsdf + ); + + + // Coat layer bsdf + bsdf coat_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : coat_color*coat_strength, + grazing_reflectivity: coat_color, + layer : df::microfacet_ggx_smith_bsdf + ( + roughness_u : (1.f - coat_glossiness)*(1.f - coat_glossiness) + ), + base : surface_bsdf, + normal : coat_bump_map + ); + +} in material +( + thin_walled : double_sided, + surface : material_surface(scattering : coat_bsdf), + backface : double_sided ? material_surface(scattering: coat_bsdf) : material_surface(), + geometry : material_geometry(displacement: state::normal()*(displacement_map)) +); + +export material VRayCarPaintMtl2 +( + // Base layer + color base_color = color(0.3f, 0.4f, 0.5f) + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base color") + ]], + float base_reflection = 0.5f + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base reflection"), + anno::hard_range(0.f, 1.f) + ]], + float base_glossiness = 0.4f + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base glossiness"), + anno::hard_range(0.f, 1.f) + ]], + float base_glossiness_tail = 2.0f + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base glossiness tail"), + anno::hard_range(0.001f, 1000.f), + anno::unused(), + anno::hidden() + ]], + uniform bool base_trace_reflections = true + [[ + anno::in_group("Base layer parameters"), + anno::display_name("Base trace reflections"), + anno::unused(), + anno::hidden() + ]], + + // Flake layer + color flake_color = color(0.3f, 0.4f, 0.8f) + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake color") + ]], + color flake_random_color = color(0.3f, 0.4f, 0.8f) + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake random color"), + anno::unused(), + anno::hidden() + ]], + float flake_orientation = 0.05f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake orientation"), + anno::hard_range(0.f, 1.f) + ]], + uniform float flake_orientation_tail = 2.0f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake orientation tail"), + anno::hard_range(0.01f, 1000.f), + anno::unused(), + anno::hidden() + ]], + uniform float flake_glossiness = 0.9f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float flake_density = 4.0f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake density"), + anno::hard_range(0.f, 7.f) + ]], + uniform float flake_uvw_scale = 1.0f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake UVW scale"), + anno::hard_range(0.f, 1.0e10f), + anno::enable_if("flake_mapping_type == 0") + ]], + uniform float flake_object_xyz_scale = 1.0f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake Object XYZ scale"), + anno::hard_range(0.f, 1.0e10f), + anno::enable_if("flake_mapping_type == 1") + ]], + uniform float flake_size = 0.5f + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake size"), + anno::hard_range(0.f, 1.0e10f) + ]], + uniform int flake_seed = 1 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake seed"), + anno::hard_range(1, 65535) + ]], + uniform int flake_map_size = 2048 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake map size"), + anno::unused(), + anno::hidden() + ]], + uniform int flake_mapping_type = 0 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake mapping type"), + anno::hard_range(0, 1) + ]], + uniform int flake_map_channel = 1 + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake map channel") + ]], + uniform bool flake_trace_reflections = true + [[ + anno::in_group("Flake layer parameters"), + anno::display_name("Flake trace reflections"), + anno::unused(), + anno::hidden() + ]], + + // Coat layer + color coat_color = color(1.0f) + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat color") + ]], + float coat_amount = 1.0f + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat amount"), + anno::hard_range(0.f, 1.f) + ]], + float coat_ior = 1.5f + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat IOR"), + anno::hard_range(0.f, 100.f) + ]], + float coat_glossiness = 1.0f + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool coat_trace_reflections = true + [[ + anno::in_group("Coat layer parameters"), + anno::display_name("Coat trace reflections"), + anno::unused(), + anno::hidden() + ]], + + // Options + uniform bool double_sided = true + [[ + anno::in_group("Options"), + anno::display_name("Double sided") + ]], + + // Maps + float3 base_bump_map = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float3 coat_bump_map = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Coat Map") + ]], + + float displacement_map = 0.f + [[ + anno::in_group("Maps"), + anno::display_name("Displacement map") + ]] + +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + // sample flake distribution + flake_noise_value val = (flake_mapping_type == 1) ? + // Object XYZ + flake_noise(state::position() / flake_object_xyz_scale*2.f, flake_size*0.8f, flake_density/7.f, flake_seed, true) : + // UVW + flake_noise(state::texture_coordinate(flake_map_channel - 1) / flake_uvw_scale*2000.0f, flake_size*0.8f, flake_density/7.f, flake_seed, true); + + bool is_flake = flake_density/7.f >= 1.0f || val.priority > 0.0f; + + // Base layer BSDF + bsdf base_bsdf = + df::fresnel_layer + ( + ior : 1.5f, + weight : base_reflection, + layer : df::microfacet_ggx_smith_bsdf + ( + roughness_u : (1.f - base_glossiness)*(1.f - base_glossiness) + ), + base : df::diffuse_reflection_bsdf + ( + tint : base_color + ), + normal : base_bump_map + ); + + // Flakes BSDF + bsdf flake_bsdf = + df::microfacet_ggx_smith_bsdf + ( + tint : flake_color, + roughness_u : (1.f - flake_glossiness)*(1.f - flake_glossiness) + ); + + bsdf surface_bsdf = + df::weighted_layer + ( + weight : is_flake ? 1.0f : 0.0f, + normal : flake_normal(val, flake_orientation*0.5f), + layer : flake_bsdf, + base : base_bsdf + ); + + bsdf coat_bsdf = + df::fresnel_layer + ( + ior : coat_ior, + // ior : invert_coat_ior ? 1.f/(coat_ior + 0.01f) : coat_ior, + weight : coat_amount, + layer : df::simple_glossy_bsdf + ( + tint : color(1.0f), + roughness_u : (1.f - coat_glossiness)*(1.f - coat_glossiness), + mode : df::scatter_reflect + ), + //base : surface_bsdf, + base : df::tint + ( + tint : coat_color,//math::lerp(color(1.f), coat_color, coat_amount), + base : surface_bsdf + ), + normal : coat_bump_map + ); + +} in material +( + thin_walled : double_sided, + surface : material_surface(scattering : coat_bsdf), + backface : double_sided ? material_surface(scattering: coat_bsdf) : material_surface(), + geometry : material_geometry(displacement: state::normal()*(displacement_map)) +); + +// VRay Light Material +export material VRayLightMtl +( + color emission = color(1.0) + [[ + anno::in_group("Parameters"), + anno::display_name("Emission") + ]], + uniform float emission_mult = 1.0 + [[ + anno::in_group("Parameters"), + anno::display_name("Mutliplier") + ]], + color opacity = color(1.0) + [[ + anno::in_group("Parameters"), + anno::display_name("Opacity") + ]], + uniform bool emit_on_backside = false + [[ + anno::in_group("Parameters"), + anno::display_name("Emit light on back side") + ]], + uniform bool mult_emission_by_opacity = false + [[ + anno::in_group("Parameters"), + anno::display_name("Mutliply emission by opacity") + ]], + float displacement = 0.f + [[ + anno::in_group("Parameters"), + anno::display_name("Displacement") + ]], + uniform float displace_amnt = 1.f + [[ + anno::in_group("Parameters"), + anno::display_name("Displacement amount") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + color emission_color = mult_emission_by_opacity ? + (emission*opacity*opacity)*emission_mult : + (emission*opacity)*emission_mult; + + bsdf surface_bsdf = + df::simple_glossy_bsdf + ( + mode: df::scatter_transmit, + tint: color(1.f) - opacity, + roughness_u: 0 + ); + + material_surface emit_surface = material_surface( + scattering: surface_bsdf, + emission: material_emission( + emission: df::diffuse_edf(), + intensity: emission_color)); +} in material +( + ior : color(1.0), + thin_walled : emit_on_backside, + surface : emit_surface, + backface : emit_on_backside ? emit_surface : material_surface(), + geometry : material_geometry( + displacement: state::normal()*(displacement*displace_amnt)) +); + +// VRay Material - Translucency Mode +export enum VRay_translucency_mode +[[ + anno::hidden() +]] +{ + translucency_none, + translucency_hard,//all modes will likely trigger the same mdl code but value might be usefull for other means + translucency_soft, + translucency_hybrid +}; + +// VRay Material - BRDF Mode +export enum VRay_brdf_mode +[[ + anno::hidden() +]] +{ + brdf_phong, + brdf_blinn, + brdf_ward, + brdf_ggx +}; + +// VRay Material - Glossy Mode +export enum VRay_brdf_glossy_mode +[[ + anno::hidden() +]] +{ + brdf_roughness, + brdf_glossiness +}; + +// VRay Material +export material VRayMtl( + color Diffuse = color(0.5f) + [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("Diffuse") + ]], + uniform float diffuse_roughness = 0.f + [[ + anno::in_group("Diffuse Parameters"), + anno::display_name("Roughness"), + anno::hard_range(0.f, 1.f) + ]], + + color Reflection = color(0.f) + [[ + anno::in_group("Reflections"), + anno::display_name("Reflect") + ]], + float reflection_glossiness = 1.f + [[ + anno::in_group("Reflections"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform bool reflection_fresnel = true + [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel reflections") + ]], + float reflection_ior = 1.6f + [[ + anno::in_group("Reflections"), + anno::display_name("Fresnel IOR"), + anno::soft_range(0.2f, 5.f), + anno::hard_range(1.e-6f, 100.f) + ]], + uniform bool reflection_lockIOR = true + [[ + anno::in_group("Reflections"), + anno::display_name("Lock IOR") + ]], + uniform bool invert_reflection_ior = false + [[ + anno::in_group("Reflections"), + anno::hidden() + ]], + float reflection_metalness = 0.f + [[ + anno::in_group("Reflections"), + anno::display_name("Metalness"), + anno::hard_range(0.f, 1.f) + ]], + + color Refraction = color(0.f) + [[ + anno::in_group("Refractions"), + anno::display_name("Refract") + ]], + float refraction_glossiness = 1.f + [[ + anno::in_group("Refractions"), + anno::display_name("Glossiness"), + anno::hard_range(0.f, 1.f) + ]], + uniform float refraction_ior = 1.6f // not textureable to be physically plausible + [[ + anno::in_group("Refractions"), + anno::display_name("IOR"), + anno::soft_range(0.2,5.), + anno::hard_range(1.e-6f, 100.f) + ]], + uniform bool invert_refraction_ior = false + [[ + anno::in_group("Refractions"), + anno::hidden() + ]], + uniform bool refraction_dispersion_on = false + [[ + anno::in_group("Refractions"), + anno::display_name("Enable dispersion"), + anno::unused(), + anno::hidden() + ]], + uniform float refraction_dispersion = 50.f + [[ + anno::in_group("Refractions"), + anno::display_name("Abbe number"), + anno::soft_range(10.f, 100.f), + anno::hard_range(1.f, 150.f), + anno::unused(), + anno::hidden() + ]], + + color refraction_fogColor = color(1.f) + [[ + anno::in_group("Fog"), + anno::display_name("Color"), + anno::unused(), + anno::hidden() + ]], + uniform float refraction_fogBias = 0.f + [[ + anno::in_group("Fog"), + anno::display_name("Bias"), + anno::unused(), + anno::hidden() + ]], + uniform float refraction_fogMult = 1.f + [[ + anno::in_group("Fog"), + anno::display_name("Multiplier"), + anno::unused(), + anno::hidden() + ]], + + uniform VRay_translucency_mode translucency_on = translucency_none + [[ + anno::in_group("Translucency"), + anno::display_name("Enable translucency"), + anno::unused(), + anno::hidden() + ]], + uniform float translucency_scatterCoeff = 0.f + [[ + anno::in_group("Translucency"), + anno::display_name("Scatter coeff"), + anno::unused(), + anno::hidden() + ]], + uniform float translucency_fbCoeff = 1.f + [[ + anno::in_group("Translucency"), + anno::display_name("Fwd/Bck coeff"), + anno::unused(), + anno::hidden() + ]], + uniform color translucency_color = color(1.f) + [[ + anno::in_group("Translucency"), + anno::display_name("Back-side color"), + anno::unused(), + anno::hidden() + ]], + + color self_illumination = color(0.f) + [[ + anno::in_group("Self-Illumination"), + anno::display_name("Self-illumination") + ]], + uniform float self_illumination_multiplier = 1.f + [[ + anno::in_group("Self-Illumination"), + anno::display_name("Multiplier") + ]], + + float coat_amount = 0.f + [[ + anno::in_group("Coat Parameters"), + anno::display_name("Coat amount"), + anno::hard_range(0.f, 1.f) + ]], + color coat_color = color(1.f) + [[ + anno::in_group("Coat Parameters"), + anno::display_name("Coat color") + ]], + float coat_glossiness = 1.f + [[ + anno::in_group("Coat Parameters"), + anno::display_name("Coat glossiness"), + anno::hard_range(0.f, 1.f) + ]], + float coat_ior = 1.6f + [[ + anno::in_group("Coat Parameters"), + anno::display_name("Coat IOR"), + anno::soft_range(0.2,5.), + anno::hard_range(1.e-6f, 100.f) + ]], + uniform bool invert_coat_ior = false + [[ + anno::in_group("Coat Parameters"), + anno::hidden() + ]], + bool coat_bump_lock = false + [[ + anno::in_group("Coat Parameters"), + anno::display_name("lock coat bump to base bump") + ]], + + color sheen_color = color(0.f) + [[ + anno::in_group("Sheen Parameters"), + anno::display_name("Sheen color"), + anno::unused(), + anno::hidden() + ]], + float sheen_glossiness = 0.8f + [[ + anno::in_group("Sheen Parameters"), + anno::display_name("Sheen glossiness"), + anno::hard_range(0.f, 1.f), + anno::unused(), + anno::hidden() + ]], + + uniform VRay_brdf_mode brdf_type = brdf_ggx + [[ + anno::in_group("BRDF"), + anno::display_name("BRDF type"), + anno::unused(), + anno::hidden() + ]], + uniform VRay_brdf_glossy_mode brdf_useRoughness = brdf_glossiness + [[ + anno::in_group("BRDF"), + anno::display_name("BRDF glossiness"), + anno::hidden() + ]], + float anisotropy = 0.f + [[ + anno::in_group("BRDF"), + anno::display_name("Anisotropy"), + anno::hard_range(-1.f, 1.f), + anno::unused(), + anno::hidden() + ]], + float anisotropy_rotation = 0.f + [[ + anno::in_group("BRDF"), + anno::display_name("Rotation"), + anno::hard_range(-10000.f, 10000.f), + anno::unused(), + anno::hidden() + ]], + uniform int anisotropy_channel = 0 //=1 in max + [[ + anno::in_group("BRDF"), + anno::display_name("Map channel"), + anno::unused(), + anno::hidden() + ]], + + float3 texmap_bump = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]], + float3 texmap_coat_bump = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Coat Map") + ]], + float texmap_opacity = 1.0f + [[ + anno::in_group("Maps"), + anno::display_name("Opacity Map") + ]], + + uniform bool thin_walled = false + [[ + anno::in_group("Options"), + anno::hidden() + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] + = let + { + float reflection_roughness = brdf_useRoughness == brdf_roughness ? + reflection_glossiness : math::pow((1.f - reflection_glossiness), 2.f); + + float refraction_roughness = brdf_useRoughness == brdf_roughness ? + refraction_glossiness : math::pow((1.f - refraction_glossiness), 2.f); + + + float refl_ior = invert_reflection_ior ? 1.f/(reflection_ior + 0.01f) : reflection_ior; + float refr_ior = invert_refraction_ior ? 1.f/(refraction_ior + 0.01f) : refraction_ior; + + float fresnel_ior = reflection_lockIOR ? refr_ior : refl_ior; + float R0 = math::pow((1.f - fresnel_ior)/(1.f + fresnel_ior), 2.f); + + // diffuse + bsdf diffuse_bsdf = + df::weighted_layer + ( + weight : 1.f, + layer : df::diffuse_reflection_bsdf + ( + tint : Diffuse, + roughness : diffuse_roughness + ), + normal : texmap_bump + ); + + // transmission + bsdf glossy_transmission_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_transmit, + tint: color(1.f), + roughness_u: refraction_roughness + ); + + // reflection + bsdf glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: reflection_fresnel ? Reflection : color(1.f), + roughness_u: reflection_roughness + ); + + // diffuse glossy reflection + bsdf diffuse_glossy_reflection_bsdf = + df::simple_glossy_bsdf( + mode: df::scatter_reflect, + tint: Diffuse, + roughness_u: reflection_roughness + ); + + // surface + bsdf surface_bsdf = + df::color_custom_curve_layer + ( + normal_reflectivity : reflection_fresnel ? color(R0) : Reflection, + grazing_reflectivity: reflection_fresnel ? color(1.f) : Reflection, + layer : glossy_reflection_bsdf, + base : + df::weighted_layer + ( + weight : reflection_metalness, + layer : diffuse_glossy_reflection_bsdf, + base : + df::color_weighted_layer + ( + weight : Refraction, + layer : glossy_transmission_bsdf, + base : diffuse_bsdf, + normal : texmap_bump + ), + normal : texmap_bump + ), + normal : texmap_bump + ); + + // coat + bsdf coat_bsdf = + df::fresnel_layer + ( + ior : invert_coat_ior ? 1.f/(coat_ior + 0.01f) : coat_ior, + weight : coat_amount, + layer : df::simple_glossy_bsdf + ( + tint : color(1.f), + roughness_u : math::pow((1.f - coat_glossiness), 2.f), + mode : df::scatter_reflect + ), + base : df::tint + ( + tint : math::lerp(color(1.f), coat_color, coat_amount), + base : surface_bsdf + ), + normal : coat_bump_lock ? texmap_bump : texmap_coat_bump + ); + +} +in material +( + ior : color(refr_ior), + thin_walled : thin_walled, + surface : material_surface + ( + scattering : coat_bsdf, + emission : material_emission + ( + emission : df::diffuse_edf(), + intensity : self_illumination*self_illumination_multiplier + ) + ), + geometry : material_geometry + ( + cutout_opacity: texmap_opacity + ) +); + +// VRay-Fast-SSS-2 Material +export material VRayFastSSS2 +( + // General parameters + uniform float scale = 1.f + [[ + anno::in_group("General Parameters"), + anno::display_name("Scale"), + anno::hard_range(0.f, 10000.f) + ]], + uniform float ior = 1.3f + [[ + anno::in_group("General Parameters"), + anno::display_name("IOR"), + anno::hard_range(0.f, 100.f) + ]], + + // Diffuse and SSS Layers + color overall_color = color(1.f) + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Overall color") + ]], + color diffuse_color = color(0.5f) + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Diffuse color") + ]], + float diffuse_amnt = 0.f + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Diffuse amount"), + anno::hard_range(0.f, 1.f) + ]], + uniform int color_mode = 0 + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Color mode"), + anno::unused(), + anno::hidden() + ]], + color sub_surface_color = color(0.5f) + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Sub-surface color") + ]], + color scatter_color = color(0.5f) + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Scatter color") + ]], + float scatter_radius = 1.f + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Scatter radius") + ]], + uniform float phase_function = 0.f + [[ + anno::in_group("Diffuse and SSS Layers"), + anno::display_name("Phase function"), + anno::hard_range(-1.f, 1.f) + ]], + + // Specular Layer + color specular_color = color(1.f) + [[ + anno::in_group("Specular Layer"), + anno::display_name("Specular color") + ]], + float specular_amnt = 1.f + [[ + anno::in_group("Specular Layer"), + anno::display_name("Specular color"), + anno::hard_range(0.f, 1.f) + ]], + float specular_glossiness = 0.6f + [[ + anno::in_group("Specular Layer"), + anno::display_name("Specular glossiness"), + anno::hard_range(0.f, 1.f) + ]], + + // Bump + float3 texmap_bump = state::normal() + [[ + anno::in_group("Maps"), + anno::display_name("Bump Map") + ]] +) +[[ + anno::author("NVIDIA Corporation") +]] += let +{ + float inv_radius = -100.f/(scatter_radius*scale); + float inv_div = 1.f/(1.f + math::max_value(scatter_color)); + color extinction = math::log(sub_surface_color*inv_div)*inv_radius; + color s = color(4.09712f) + 4.20863f*scatter_color - math::sqrt(9.59217f + 41.6808f*scatter_color + 17.7126f*scatter_color*scatter_color); + color ss_albedo = s*s; + + color absorption = extinction*ss_albedo; + color scattering = extinction - absorption; + + bsdf diffuse_sss_bsdf = df::weighted_layer + ( + weight : diffuse_amnt, + layer : df::diffuse_reflection_bsdf + ( + tint : diffuse_color + ), + base : df::diffuse_transmission_bsdf() + ); + + bsdf specular_bsdf = df::simple_glossy_bsdf + ( + mode : df::scatter_reflect, + tint : specular_color*specular_amnt, + roughness_u : 1.f - specular_glossiness + ); + + bsdf overall_bsdf = df::tint + ( + tint : overall_color, + base : df::fresnel_layer + ( + ior : ior, + layer : specular_bsdf, + base : diffuse_sss_bsdf + ) + + ); + +} +in material +( + ior : color(ior), + surface : material_surface + ( + scattering : overall_bsdf + ), + volume : material_volume + ( + scattering : df::anisotropic_vdf(phase_function), + absorption_coefficient : absorption, + scattering_coefficient : scattering + ), + geometry: material_geometry + ( + normal: texmap_bump + ) + +); diff --git a/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/vbvdvbdf.mdl b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/vbvdvbdf.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a90b330c71c5a295cd11d723a7aff6e79de9c49 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/peg_in_hole/merge_usd/0019/Materials/vbvdvbdf.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material vbvdvbdf() +[[ + anno::display_name("vbvdvbdf") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.709804,0.54902,0.113725), + diffuse_roughness : 0.0f, + Reflection : color(0.235294,0.235294,0.235294), + reflection_glossiness : 0.8f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/put_glass_in_glassbox/down/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5cc80aa20b160a6671d2417d.mdl b/assets/scene_usds/ebench/teleop_tasks/put_glass_in_glassbox/down/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5cc80aa20b160a6671d2417d.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cce2706bb137dd9ea17f4dc84e8972dd0ee978ff --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/put_glass_in_glassbox/down/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/Num5cc80aa20b160a6671d2417d.mdl @@ -0,0 +1,284 @@ +mdl 1.6; + +import ::math::*; +import ::state::*; +import ::tex::*; +import ::anno::*; +using OmniUe4Function import *; +using OmniUe4Base import *; + +export annotation sampler_color(); +export annotation sampler_normal(); +export annotation sampler_grayscale(); +export annotation sampler_alpha(); +export annotation sampler_masks(); +export annotation sampler_distancefield(); +export annotation dither_masked_off(); +export annotation world_space_normal(); + +export material Num5cc80aa20b160a6671d2417d( + uniform texture_2d Normal_Tex = texture_2d("./Textures/normal.png",::tex::gamma_linear) + [[ + anno::display_name("Normal_Tex"), + anno::ui_order(32), + anno::in_group("Normal"), + sampler_normal() + ]], + float4 Normal_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Normal_UVA"), + anno::ui_order(32), + anno::in_group("Normal") + ]], + float EmissiveIntensity = 0.0 + [[ + anno::display_name("EmissiveIntensity"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsEmissiveTex = 0.0 + [[ + anno::display_name("IsEmissiveTex"), + anno::in_group("EmissiveColor") + ]], + float4 Emissive_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Emissive_Color"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + uniform texture_2d Emissive_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Emissive_Tex"), + anno::ui_order(32), + anno::in_group("EmissiveColor"), + sampler_color() + ]], + float4 Emissive_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Emissive_UVA"), + anno::ui_order(32), + anno::in_group("EmissiveColor") + ]], + float IsBaseColorTex = 0.0 + [[ + anno::display_name("IsBaseColorTex"), + anno::in_group("BaseColor") + ]], + float4 BaseColor_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("BaseColor_Color"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + uniform texture_2d BaseColor_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("BaseColor_Tex"), + anno::ui_order(32), + anno::in_group("BaseColor"), + sampler_color() + ]], + float4 BaseColor_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("BaseColor_UVA"), + anno::ui_order(32), + anno::in_group("BaseColor") + ]], + float IsMetallicTex = 0.0 + [[ + anno::display_name("IsMetallicTex"), + anno::in_group("Metallic") + ]], + float4 Metallic_Color = float4(0.0,0.0,0.0,1.0) + [[ + anno::display_name("Metallic_Color"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + uniform texture_2d Metallic_Tex = texture_2d("./Textures/black.png",::tex::gamma_srgb) + [[ + anno::display_name("Metallic_Tex"), + anno::ui_order(32), + anno::in_group("Metallic"), + sampler_color() + ]], + float4 Metallic_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Metallic_UVA"), + anno::ui_order(32), + anno::in_group("Metallic") + ]], + float IsSpecularTex = 0.0 + [[ + anno::display_name("IsSpecularTex"), + anno::in_group("Specular") + ]], + float4 Specular_Color = float4(1.0,1.0,1.0,1.0) + [[ + anno::display_name("Specular_Color"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + uniform texture_2d Specular_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Specular_Tex"), + anno::ui_order(32), + anno::in_group("Specular"), + sampler_color() + ]], + float4 Specular_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Specular_UVA"), + anno::ui_order(32), + anno::in_group("Specular") + ]], + float IsGlossTex = 0.0 + [[ + anno::display_name("IsGlossTex"), + anno::in_group("Roughness") + ]], + float4 Gloss_Color = float4(0.1,0.1,0.1,1.0) + [[ + anno::display_name("Gloss_Color"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + uniform texture_2d Gloss_Tex = texture_2d("./Textures/white.png",::tex::gamma_srgb) + [[ + anno::display_name("Gloss_Tex"), + anno::ui_order(32), + anno::in_group("Roughness"), + sampler_color() + ]], + float4 Gloss_UVA = float4(1.0,1.0,0.0,0.0) + [[ + anno::display_name("Gloss_UVA"), + anno::ui_order(32), + anno::in_group("Roughness") + ]], + float PolygonOffset = 0.0 + [[ + anno::display_name("PolygonOffset"), + anno::ui_order(32), + anno::in_group("WorldPosition") + ]], + int MaxTexCoordIndex = 3 + [[ + anno::hidden() + ]]) + = + let { + float3 Local82 = ::camera_position(); + float3 Local83 = (Local82 - (::convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), true)*state::meters_per_scene_unit()*100.0)); + float Local84 = math::dot(Local83, Local83); + float Local85 = math::sqrt(Local84); + float3 Local86 = (Local83 / Local85); + float3 Local87 = (Local86 * PolygonOffset); + + float3 WorldPositionOffset_mdl = Local87; + float2 CustomizedUV0_mdl = float2(state::texture_coordinate(math::min(0,MaxTexCoordIndex)).x,1.0-state::texture_coordinate(math::min(0,MaxTexCoordIndex)).y); + + float2 Local0 = (float2(0.5,0.5) * -1.0); + float Local1 = (CustomizedUV0_mdl.x * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).x); + float Local2 = (CustomizedUV0_mdl.y * float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).y); + float2 Local3 = (Local0 + float2(Local1,Local2)); + float Local4 = (3.141592 * -2.0); + float Local5 = (float3(Normal_UVA.x,Normal_UVA.y,Normal_UVA.z).z / Local4); + float Local6 = (Local5 * 6.283185); + float Local7 = math::cos(Local6); + float Local8 = math::sin(Local6); + float Local9 = (Local8 * -1.0); + float Local10 = math::dot(Local3, float2(Local7,Local9)); + float Local11 = math::dot(Local3, float2(Local8,Local7)); + float2 Local12 = (float2(0.5,0.5) + float2(Local10,Local11)); + float4 Local13 = ::unpack_normal_map(tex::lookup_float4(Normal_Tex,float2(Local12.x,1.0-Local12.y),tex::wrap_repeat,tex::wrap_repeat)); + float3 Local14 = ((math::abs(1.0 - 1.0) > 0.00001) ? (float3(0.0,0.0,0.0)) : float3(Local13.x,Local13.y,Local13.z)); + + float3 Normal_mdl = Local14; + + float Local15 = (CustomizedUV0_mdl.x * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).x); + float Local16 = (CustomizedUV0_mdl.y * float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).y); + float2 Local17 = (Local0 + float2(Local15,Local16)); + float Local18 = (float3(Emissive_UVA.x,Emissive_UVA.y,Emissive_UVA.z).z / Local4); + float Local19 = (Local18 * 6.283185); + float Local20 = math::cos(Local19); + float Local21 = math::sin(Local19); + float Local22 = (Local21 * -1.0); + float Local23 = math::dot(Local17, float2(Local20,Local22)); + float Local24 = math::dot(Local17, float2(Local21,Local20)); + float2 Local25 = (float2(0.5,0.5) + float2(Local23,Local24)); + float4 Local26 = tex::lookup_float4(Emissive_Tex,float2(Local25.x,1.0-Local25.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local27 = ((math::abs(IsEmissiveTex - 1.0) > 0.00001) ? (float3(Emissive_Color.x,Emissive_Color.y,Emissive_Color.z)) : float3(Local26.x,Local26.y,Local26.z)); + float3 Local28 = (EmissiveIntensity * Local27); + float Local29 = (CustomizedUV0_mdl.x * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).x); + float Local30 = (CustomizedUV0_mdl.y * float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).y); + float2 Local31 = (Local0 + float2(Local29,Local30)); + float Local32 = (float3(BaseColor_UVA.x,BaseColor_UVA.y,BaseColor_UVA.z).z / Local4); + float Local33 = (Local32 * 6.283185); + float Local34 = math::cos(Local33); + float Local35 = math::sin(Local33); + float Local36 = (Local35 * -1.0); + float Local37 = math::dot(Local31, float2(Local34,Local36)); + float Local38 = math::dot(Local31, float2(Local35,Local34)); + float2 Local39 = (float2(0.5,0.5) + float2(Local37,Local38)); + float4 Local40 = tex::lookup_float4(BaseColor_Tex,float2(Local39.x,1.0-Local39.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local41 = ((math::abs(IsBaseColorTex - 1.0) > 0.00001) ? (float3(BaseColor_Color.x,BaseColor_Color.y,BaseColor_Color.z)) : float3(Local40.x,Local40.y,Local40.z)); + float Local42 = (CustomizedUV0_mdl.x * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).x); + float Local43 = (CustomizedUV0_mdl.y * float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).y); + float2 Local44 = (Local0 + float2(Local42,Local43)); + float Local45 = (float3(Metallic_UVA.x,Metallic_UVA.y,Metallic_UVA.z).z / Local4); + float Local46 = (Local45 * 6.283185); + float Local47 = math::cos(Local46); + float Local48 = math::sin(Local46); + float Local49 = (Local48 * -1.0); + float Local50 = math::dot(Local44, float2(Local47,Local49)); + float Local51 = math::dot(Local44, float2(Local48,Local47)); + float2 Local52 = (float2(0.5,0.5) + float2(Local50,Local51)); + float4 Local53 = tex::lookup_float4(Metallic_Tex,float2(Local52.x,1.0-Local52.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local54 = ((math::abs(IsMetallicTex - 1.0) > 0.00001) ? (float3(Metallic_Color.x,Metallic_Color.y,Metallic_Color.z)) : float3(Local53.x,Local53.y,Local53.z)); + float Local55 = (CustomizedUV0_mdl.x * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).x); + float Local56 = (CustomizedUV0_mdl.y * float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).y); + float2 Local57 = (Local0 + float2(Local55,Local56)); + float Local58 = (float3(Specular_UVA.x,Specular_UVA.y,Specular_UVA.z).z / Local4); + float Local59 = (Local58 * 6.283185); + float Local60 = math::cos(Local59); + float Local61 = math::sin(Local59); + float Local62 = (Local61 * -1.0); + float Local63 = math::dot(Local57, float2(Local60,Local62)); + float Local64 = math::dot(Local57, float2(Local61,Local60)); + float2 Local65 = (float2(0.5,0.5) + float2(Local63,Local64)); + float4 Local66 = tex::lookup_float4(Specular_Tex,float2(Local65.x,1.0-Local65.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local67 = ((math::abs(IsSpecularTex - 1.0) > 0.00001) ? (float3(Specular_Color.x,Specular_Color.y,Specular_Color.z)) : float3(Local66.x,Local66.y,Local66.z)); + float Local68 = (CustomizedUV0_mdl.x * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).x); + float Local69 = (CustomizedUV0_mdl.y * float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).y); + float2 Local70 = (Local0 + float2(Local68,Local69)); + float Local71 = (float3(Gloss_UVA.x,Gloss_UVA.y,Gloss_UVA.z).z / Local4); + float Local72 = (Local71 * 6.283185); + float Local73 = math::cos(Local72); + float Local74 = math::sin(Local72); + float Local75 = (Local74 * -1.0); + float Local76 = math::dot(Local70, float2(Local73,Local75)); + float Local77 = math::dot(Local70, float2(Local74,Local73)); + float2 Local78 = (float2(0.5,0.5) + float2(Local76,Local77)); + float4 Local79 = tex::lookup_float4(Gloss_Tex,float2(Local78.x,1.0-Local78.y),tex::wrap_repeat,tex::wrap_repeat); + float3 Local80 = ((math::abs(IsGlossTex - 1.0) > 0.00001) ? (float3(Gloss_Color.x,Gloss_Color.y,Gloss_Color.z)) : float3(Local79.x,Local79.y,Local79.z)); + float3 Local81 = (1.0 - Local80); + + float3 EmissiveColor_mdl = Local28; + float OpacityMask_mdl = 1.0; + float3 BaseColor_mdl = Local41; + float Metallic_mdl = Local54.x; + float Specular_mdl = Local67.x; + float Roughness_mdl = Local81.x; + + } in + ::OmniUe4Base( + base_color: BaseColor_mdl, + metallic: Metallic_mdl, + roughness: Roughness_mdl, + specular: Specular_mdl, + normal: Normal_mdl, + opacity: OpacityMask_mdl, + emissive_color: EmissiveColor_mdl, + displacement: WorldPositionOffset_mdl, + two_sided: false); diff --git a/assets/scene_usds/ebench/teleop_tasks/put_glass_in_glassbox/down/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl b/assets/scene_usds/ebench/teleop_tasks/put_glass_in_glassbox/down/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl new file mode 100644 index 0000000000000000000000000000000000000000..a441fbaf28040302c7aaabfbcf14b24a85bdf643 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/put_glass_in_glassbox/down/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Base.mdl @@ -0,0 +1,224 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.0 - first version +//* 1.0.1 - merge unlit template +//* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side +//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed +//* 1.0.4 - using absolute import paths when importing standard modules + +mdl 1.3; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + +float emissive_multiplier() +[[ + anno::description("the multiplier to convert UE4 emissive to raw data"), + anno::noinline() +]] +{ + return 20.0f * 128.0f; +} + +float3 tangent_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in tangent space"), + anno::noinline() +]] +{ + return math::normalize( + tangent_u * normal.x - /* flip_tangent_v */ + tangent_v * normal.y + + state::normal() * (normal.z)); +} + +float3 world_space_normal( + float3 normal = float3(0.0,0.0,1.0), + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0) +) +[[ + anno::description("Interprets the vector in world space"), + anno::noinline() +]] +{ + return tangent_space_normal( + math::normalize( + normal.x * float3(tangent_u.x, tangent_v.x, state::normal().x) - + normal.y * float3(tangent_u.y, tangent_v.y, state::normal().y) + + normal.z * float3(tangent_u.z, tangent_v.z, state::normal().z)), + tangent_u, + tangent_v + ); +} + +export material OmniUe4Base( + float3 base_color = float3(0.0, 0.0, 0.0), + float metallic = 0.0, + float roughness = 0.5, + float specular = 0.5, + float3 normal = float3(0.0,0.0,1.0), + float clearcoat_weight = 0.0, + float clearcoat_roughness = 0.0, + float3 clearcoat_normal = float3(0.0,0.0,1.0), + uniform bool enable_opacity = true, + float opacity = 1.0, + float3 emissive_color = float3(0.0, 0.0, 0.0), + float3 displacement = float3(0.0), + uniform bool is_tangent_space_normal = true, + uniform bool two_sided = false, + uniform bool is_unlit = false +) +[[ + anno::display_name("Omni UE4 Base"), + anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"), + anno::version( 1, 0, 0), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic")) +]] + = let { + color final_base_color = math::saturate(base_color); + float final_metallic = math::saturate(metallic); + float final_roughness = math::saturate(roughness); + float final_specular = math::saturate(specular); + color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/ + float final_clearcoat_weight = math::saturate(clearcoat_weight); + float final_clearcoat_roughness = math::saturate(clearcoat_roughness); + float3 final_normal = math::normalize(normal); + float3 final_clearcoat_normal = math::normalize(clearcoat_normal); + + // - compute final roughness by squaring the "roughness" parameter + float alpha = final_roughness * final_roughness; + // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering + float grazing_refl = math::max((1.0 - final_roughness), 0.0); + + float3 the_normal = is_unlit ? state::normal() : + (is_tangent_space_normal ? + tangent_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + )); + + // for the dielectric component we layer the glossy component on top of the diffuse one, + // the glossy layer has no color tint + + bsdf dielectric_component = df::custom_curve_layer( + weight: final_specular, + normal_reflectivity: 0.08, + grazing_reflectivity: grazing_refl, + layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha), + base: df::diffuse_reflection_bsdf(tint: final_base_color), + normal: the_normal); + + // the metallic component doesn't have a diffuse component, it's only glossy + // base_color is applied to tint it + bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha); + + // final BSDF is a linear blend between dielectric and metallic component + bsdf dielectric_metal_mix = + df::normalized_mix( + components: + df::bsdf_component[]( + df::bsdf_component( + component: metallic_component, + weight: final_metallic), + df::bsdf_component( + component: dielectric_component, + weight: 1.0-final_metallic) + ) + ); + + // clearcoat layer + float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0); + float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness; + + float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ) : world_space_normal( + normal: final_clearcoat_normal, + tangent_u: state::texture_tangent_u(0), + tangent_v: state::texture_tangent_v(0) + ); + + + bsdf clearcoat = + df::custom_curve_layer( + base: df::weighted_layer( + layer: dielectric_metal_mix, + weight: 1.0, + normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal + ), + layer: df::microfacet_ggx_smith_bsdf( + roughness_u: clearcoat_alpha, + tint: color(1.0) + ), + normal_reflectivity: 0.04, + grazing_reflectivity: clearcoat_grazing_refl, + normal: the_clearcoat_normal, + weight: final_clearcoat_weight + ); + bsdf surface = is_unlit ? bsdf() : clearcoat; +} +in material( + thin_walled: two_sided, // Graphene? + surface: material_surface( + scattering: surface, + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + backface: material_surface( + emission: + material_emission ( + emission: df::diffuse_edf (), + intensity: final_emissive_color + ) + ), + geometry: material_geometry( + displacement: displacement, + normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(), + cutout_opacity: enable_opacity ? opacity : 1.0 + ) +); diff --git a/assets/scene_usds/ebench/teleop_tasks/put_glass_in_glassbox/down/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl b/assets/scene_usds/ebench/teleop_tasks/put_glass_in_glassbox/down/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f0801afff6f0870ea2574c9e9b6e2043e79e9a79 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/put_glass_in_glassbox/down/flip_cup_collect_cookies/shared/smartbot/jiamingda/data_code/simbench/MesaTask-USD/simbench_shared/GRSceneUSD_dexterous/task1/Collected_scene_remote_manip/gaoning/GenManip-Sim/saved/assets/miscs/home_scenes/Materials/OmniUe4Function.mdl @@ -0,0 +1,1413 @@ +/*************************************************************************************************** + * Copyright 2020 NVIDIA Corporation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + **************************************************************************************************/ + +//* 1.0.1 - using absolute import paths when importing standard modules + +mdl 1.6; + +import ::df::*; +import ::state::*; +import ::math::*; +import ::tex::*; +import ::anno::*; + + +export float3 convert_to_left_hand(float3 vec3, uniform bool up_z = true, uniform bool is_position = true) +[[ + anno::description("convert from RH to LH"), + anno::noinline() +]] +{ + float4x4 ZupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4x4 YupConversion = float4x4( + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f + ); + + float4 vec4 = float4(vec3.x, vec3.y, vec3.z, is_position ? 1.0f : 0.0f); + + vec4 = vec4 * (up_z ? ZupConversion : YupConversion); + + return float3(vec4.x, vec4.y, vec4.z); +} + +export float3 transform_vector_from_tangent_to_world(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from tangent space to world space"), + anno::noinline() +]] +{ + /* flip_tangent_v */ + return convert_to_left_hand( + tangent_u * vector.x - tangent_v * vector.y + state::normal() * vector.z, + up_z, false); +} + +export float3 transform_vector_from_world_to_tangent(float3 vector, + uniform bool up_z = true, + float3 tangent_u = state::texture_tangent_u(0), + float3 tangent_v = state::texture_tangent_v(0)) +[[ + anno::description("Transform vector from world space to tangent space"), + anno::noinline() +]] +{ + float3 vecRH = convert_to_left_hand(vector, up_z, false); + /* flip_tangent_v */ + return vecRH.x * float3(tangent_u.x, -tangent_v.x, state::normal().x) + + vecRH.y * float3(tangent_u.y, -tangent_v.y, state::normal().y) + + vecRH.z * float3(tangent_u.z, -tangent_v.z, state::normal().z); +} + +export float4 unpack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Unpack a normal stored in a normal map"), + anno::noinline() +]] +{ + float2 normal_xy = float2(texture_sample.x, texture_sample.y); + + normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0); + float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) ); + return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 ); +} + +// for get color value from normal. +export float4 pack_normal_map( + float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0) + ) +[[ + anno::description("Pack to color from a normal") +]] +{ + float2 return_xy = float2(texture_sample.x, texture_sample.y); + + return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0); + + return float4( return_xy.x, return_xy.y, 0.0, 1.0 ); +} + +export float4 greyscale_texture_lookup( + float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0) + ) +[[ + anno::description("Sampling a greyscale texture"), + anno::noinline() +]] +{ + return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x); +} + +export float3 pixel_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Pixel normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 vertex_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Vertex normal in world space"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); +} + +export float3 landscape_normal_world_space(uniform bool up_z = true) +[[ + anno::description("Landscape normal in world space") +]] +{ + float3 normalFromNormalmap = math::floor((::vertex_normal_world_space(up_z) * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0; + + float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y); + return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY)))); +} + +// Different implementation specific between mdl and hlsl for smoothstep +export float smoothstep(float a, float b, float l) +{ + if (a < b) + { + return math::smoothstep(a, b, l); + } + else if (a > b) + { + return 1.0 - math::smoothstep(b, a, l); + } + else + { + return l <= a ? 0.0 : 1.0; + } +} + +export float2 smoothstep(float2 a, float2 b, float2 l) +{ + return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y)); +} + +export float3 smoothstep(float3 a, float3 b, float3 l) +{ + return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z)); +} + +export float4 smoothstep(float4 a, float4 b, float4 l) +{ + return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w)); +} + +export float2 smoothstep(float2 a, float2 b, float l) +{ + return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l)); +} + +export float3 smoothstep(float3 a, float3 b, float l) +{ + return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l)); +} + +export float4 smoothstep(float4 a, float4 b, float l) +{ + return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l)); +} + +export float2 smoothstep(float a, float b, float2 l) +{ + return float2(smoothstep(a, b, l.x), smoothstep(a, b, l.y)); +} + +export float3 smoothstep(float a, float b, float3 l) +{ + return float3(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z)); +} + +export float4 smoothstep(float a, float b, float4 l) +{ + return float4(smoothstep(a, b, l.x), smoothstep(a, b, l.y), smoothstep(a, b, l.z), smoothstep(a, b, l.w)); +} + +//------------------ Random from UE4 ----------------------- +float length2(float3 v) +{ + return math::dot(v, v); +} + +float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v) +{ + const float2 ZShear = float2(17.0f, 89.0f); + + float2 OffsetA = v.z * ZShear; + float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f; + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat); + return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0; +} + +float3 SkewSimplex(float3 In) +{ + return In + math::dot(In, float3(1.0 / 3.0f) ); +} +float3 UnSkewSimplex(float3 In) +{ + return In - math::dot(In, float3(1.0 / 6.0f) ); +} + +// 3D random number generator inspired by PCGs (permuted congruential generator) +// Using a **simple** Feistel cipher in place of the usual xor shift permutation step +// @param v = 3D integer coordinate +// @return three elements w/ 16 random bits each (0-0xffff). +// ~8 ALU operations for result.x (7 mad, 1 >>) +// ~10 ALU operations for result.xy (8 mad, 2 >>) +// ~12 ALU operations for result.xyz (9 mad, 3 >>) + +//TODO: uint3 +int3 Rand3DPCG16(int3 p) +{ + // taking a signed int then reinterpreting as unsigned gives good behavior for negatives + //TODO: uint3 + int3 v = int3(p); + + // Linear congruential step. These LCG constants are from Numerical Recipies + // For additional #'s, PCG would do multiple LCG steps and scramble each on output + // So v here is the RNG state + v = v * 1664525 + 1013904223; + + // PCG uses xorshift for the final shuffle, but it is expensive (and cheap + // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps + // + // Feistel ciphers divide the state into separate parts (usually by bits) + // then apply a series of permutation steps one part at a time. The permutations + // use a reversible operation (usually ^) to part being updated with the result of + // a permutation function on the other parts and the key. + // + // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for + // the combination function, and just multiplying the other two parts (no key) for + // the permutation function. + // + // That gives a simple mad per round. + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + v.x += v.y*v.z; + v.y += v.z*v.x; + v.z += v.x*v.y; + + // only top 16 bits are well shuffled + return v >> 16; +} + +// Wraps noise for tiling texture creation +// @param v = unwrapped texture parameter +// @param bTiling = true to tile, false to not tile +// @param RepeatSize = number of units before repeating +// @return either original or wrapped coord +float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize) +{ + return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v; +} + +// Evaluate polynomial to get smooth transitions for Perlin noise +// only needed by Perlin functions in this file +// scalar(per component): 2 add, 5 mul +float4 PerlinRamp(float4 t) +{ + return t * t * t * (t * (t * 6 - 15) + 10); +} + +// Blum-Blum-Shub-inspired pseudo random number generator +// http://www.umbc.edu/~olano/papers/mNoise.pdf +// real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes +// instead, we use a single prime M just small enough not to overflow +// note that the above paper used 61, which fits in a half, but is unusably bad +// @param Integer valued floating point seed +// @return random number in range [0,1) +// ~8 ALU operations (5 *, 3 frac) +float RandBBSfloat(float seed) +{ + float BBS_PRIME24 = 4093.0; + float s = math::frac(seed / BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + s = math::frac(s * s * BBS_PRIME24); + return s; +} + +// Modified noise gradient term +// @param seed - random seed for integer lattice position +// @param offset - [-1,1] offset of evaluation point from lattice point +// @return gradient direction (xyz) and contribution (w) from this lattice point +float4 MGradient(int seed, float3 offset) +{ + //TODO uint + int rand = Rand3DPCG16(int3(seed,0,0)).x; + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000); + float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1; + return float4(direction.x, direction.y, direction.z, math::dot(direction, offset)); +} + +// compute Perlin and related noise corner seed values +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = true to return seed values for a repeating noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @param seed000-seed111 = hash function seeds for the eight corners +// @return fractional part of v +struct SeedValue +{ + float3 fv = float3(0); + float seed000 = 0; + float seed001 = 0; + float seed010 = 0; + float seed011 = 0; + float seed100 = 0; + float seed101 = 0; + float seed110 = 0; + float seed111 = 0; +}; + +SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds; + seeds.fv = math::frac(v); + float3 iv = math::floor(v); + + const float3 primes = float3(19, 47, 101); + + if (bTiling) + { // can't algebraically combine with primes + seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize)); + seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize)); + seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize)); + seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize)); + seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize)); + seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize)); + seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize)); + seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize)); + } + else + { // get to combine offsets with multiplication by primes in this case + seeds.seed000 = math::dot(iv, primes); + seeds.seed100 = seeds.seed000 + primes.x; + seeds.seed010 = seeds.seed000 + primes.y; + seeds.seed110 = seeds.seed100 + primes.y; + seeds.seed001 = seeds.seed000 + primes.z; + seeds.seed101 = seeds.seed100 + primes.z; + seeds.seed011 = seeds.seed010 + primes.z; + seeds.seed111 = seeds.seed110 + primes.z; + } + + return seeds; +} + +struct SimplexWeights +{ + float4 Result = float4(0); + float3 PosA = float3(0); + float3 PosB = float3(0); + float3 PosC = float3(0); + float3 PosD = float3(0); +}; + +// Computed weights and sample positions for simplex interpolation +// @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d +SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos) +{ + SimplexWeights weights; + float3 OrthogonalPosFloor = math::floor(OrthogonalPos); + + weights.PosA = OrthogonalPosFloor; + weights.PosB = weights.PosA + float3(1, 1, 1); + + OrthogonalPos -= OrthogonalPosFloor; + + float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z)); + float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z)); + + weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z); + weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z); + + float RG = OrthogonalPos.x - OrthogonalPos.y; + float RB = OrthogonalPos.x - OrthogonalPos.z; + float GB = OrthogonalPos.y - OrthogonalPos.z; + + weights.Result.z = + math::min(math::max(0, RG), math::max(0, RB)) // X + + math::min(math::max(0, -RG), math::max(0, GB)) // Y + + math::min(math::max(0, -RB), math::max(0, -GB)); // Z + + weights.Result.w = + math::min(math::max(0, -RG), math::max(0, -RB)) // X + + math::min(math::max(0, RG), math::max(0, -GB)) // Y + + math::min(math::max(0, RB), math::max(0, GB)); // Z + + weights.Result.y = Smallest; + weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w; + + return weights; +} + +// filtered 3D gradient simple noise (few texture lookups, high quality) +// @param v >0 +// @return random number in the range -1 .. 1 +float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos) +{ + float3 OrthogonalPos = SkewSimplex(EvalPos); + + SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos); + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit) + float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA); + float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB); + float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC); + float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD); + + Weights.PosA = UnSkewSimplex(Weights.PosA); + Weights.PosB = UnSkewSimplex(Weights.PosB); + Weights.PosC = UnSkewSimplex(Weights.PosC); + Weights.PosD = UnSkewSimplex(Weights.PosD); + + float DistanceWeight; + + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight; + DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight; + float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight; + + return 32 * (a + b + c + d); +} + +// filtered 3D noise, can be optimized +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize) +{ + bTiling = true; + float3 fv = math::frac(v); + float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize); + float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize); + + const int2 ZShear = int2(17, 89); + + float2 OffsetA = iv0.z * ZShear; + float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset + if (bTiling) // tiling, have to compute from wrapped coordinates + { + OffsetB = iv1.z * ZShear; + } + + // Texture size scale factor + float ts = 1 / 128.0f; + + // texture coordinates for iv0.xy, as offset for both z slices + float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts; + float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts; + + // texture coordinates for iv1.xy, as offset for both z slices + float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates + float2 TexB1 = TexB0 + ts; + if (bTiling) // for tiling, need to compute from wrapped coordinates + { + TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts; + TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts; + } + + + // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit) + float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 A = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 B = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 C = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 D = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 E = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 F = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 G = PerlinNoiseColor * 2 - 1; + PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat); + PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z); + float3 H = PerlinNoiseColor * 2 - 1; + + float a = math::dot(A, fv - float3(0, 0, 0)); + float b = math::dot(B, fv - float3(1, 0, 0)); + float c = math::dot(C, fv - float3(0, 1, 0)); + float d = math::dot(D, fv - float3(1, 1, 0)); + float e = math::dot(E, fv - float3(0, 0, 1)); + float f = math::dot(F, fv - float3(1, 0, 1)); + float g = math::dot(G, fv - float3(0, 1, 1)); + float h = math::dot(H, fv - float3(1, 1, 1)); + + float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0))); + + float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y); + float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y); + + return math::lerp(i, j, Weights.z); +} + +// @return random number in the range -1 .. 1 +// scalar: 6 frac, 31 mul/mad, 15 add, +float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz) +{ + // needs to be the same value when creating the PerlinNoise3D texture + float Extent = 16; + + // last texel replicated and needed for filtering + // scalar: 3 frac, 6 mul + xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1); + + // scalar: 3 frac + float3 uvw = math::frac(xyz); + // = floor(xyz); + // scalar: 3 add + float3 p0 = xyz - uvw; +// float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping) + // scalar: 2*3 add 5*3 mul + float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0)); + float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping + // scalar: 3 add + float3 p = p0 + f; + // scalar: 3 mad + // TODO: need reverse??? + float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset + + // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count) + // scalar: 4 mad, 3 mul, 3 add + float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f; + float d = NoiseSample.w * 255.f - 127; + return math::dot(xyz, n) - d; +} + +// Perlin-style "Modified Noise" +// http://www.umbc.edu/~olano/papers/index.html#mNoise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w; + float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w; + float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w; + float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w; + float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w; + float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w; + float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w; + float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D value noise - used to be incorrectly called Perlin noise +// @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D +// @param bTiling = repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension +// @return random number in the range -1 .. 1 +float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize) +{ + SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize); + + float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1; + float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1; + float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1; + float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1; + float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1; + float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1; + float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1; + float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1; + + float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0)); + + float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y); + float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y); + return math::lerp(i, j, Weights.z); +} + +// 3D jitter offset within a voronoi noise cell +// @param pos - integer lattice corner +// @return random offsets vector +float3 VoronoiCornerSample(float3 pos, int Quality) +{ + // random values in [-0.5, 0.5] + float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5; + + // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 2x2x2 search + if (Quality <= 2) + { + return math::normalize(noise) * 0.2588; + } + + // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere + // scale factor to guarantee jittered points will be found within a 3x3x3 search + if (Quality == 3) + { + return math::normalize(noise) * 0.3090; + } + + // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search + return noise; +} + +// compare previous best with a new candidate +// not producing point locations makes it easier for compiler to eliminate calculations when they're not needed +// @param minval = location and distance of best candidate seed point before the new one +// @param candidate = candidate seed point +// @param offset = 3D offset to new candidate seed point +// @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position +// @return position (if bDistanceOnly is false) and distance to closest seed point so far +float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly) +{ + if (bDistanceOnly) + { + return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset))); + } + else + { + float newdist = math::dot(offset, offset); + return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist); + } +} + +// 220 instruction Worley noise +float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly) +{ + float3 fv = math::frac(v), fv2 = math::frac(v + 0.5); + float3 iv = math::floor(v), iv2 = math::floor(v + 0.5); + + // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away + float4 mindist = float4(0,0,0,100); + float3 p, offset; + + // quality level 3: do a 3x3x3 search + if (Quality == 3) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 1; ++offset_x) + { + for (offset_y = -1; offset_y <= 1; ++offset_y) + { + for (offset_z = -1; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + + // everybody else searches a base 2x2x2 neighborhood + else + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = 0; offset_x <= 1; ++offset_x) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // quality level 2, do extra set of points, offset by half a cell + if (Quality == 2) + { + // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts + p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality); + mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly); + } + } + } + } + } + + // quality level 4: add extra sets of four cells in each direction + if (Quality >= 4) + { + int offset_x; + int offset_y; + int offset_z; + for (offset_x = -1; offset_x <= 2; offset_x += 3) + { + for (offset_y = 0; offset_y <= 1; ++offset_y) + { + for (offset_z = 0; offset_z <= 1; ++offset_z) + { + offset = float3(offset_x, offset_y, offset_z); + // along x axis + p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along y axis + p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + + // along z axis + p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality); + mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly); + } + } + } + } + + // transform squared distance to real distance + return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w)); +} + +// Coordinates for corners of a Simplex tetrahedron +// Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011 +// @param v = 3D noise argument +// @return 4 corner locations +float4x3 SimplexCorners(float3 v) +{ + // find base corner by skewing to tetrahedral space and back + float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3); + float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6; + float3 f = v - base; + + // Find offsets to other corners (McEwan did this in tetrahedral space, + // but since skew is along x=y=z axis, this works in Euclidean space too.) + float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y); + float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0; + + // four corners + return float4x3(base, base + a1, base + a2, base + 0.5); +} + +// Improved smoothing function for simplex noise +// @param f = fractional distance to four tetrahedral corners +// @return weight for each corner +float4 SimplexSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale))); +} + +// Derivative of simplex noise smoothing function +// @param f = fractional distanc eto four tetrahedral corners +// @return derivative of smoothing function for each corner by x, y and z +float3x4 SimplexDSmooth(float4x3 f) +{ + const float scale = 1024. / 375.; // scale factor to make noise -1..1 + float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3])); + float4 s = math::saturate(2 * d); + s = -12 * scale + s*(24 * scale - s * 12 * scale); + + return float3x4( + s * float4(f[0][0], f[1][0], f[2][0], f[3][0]), + s * float4(f[0][1], f[1][1], f[2][1], f[3][1]), + s * float4(f[0][2], f[1][2], f[2][2], f[3][2])); +} + +// Simplex noise and its Jacobian derivative +// @param v = 3D noise argument +// @param bTiling = whether to repeat noise pattern +// @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3 +// @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w +// J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz) +// J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx +// You can use this to compute the noise, gradient, curl, or divergence: +// float3x4 J = JacobianSimplex_ALU(...); +// float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise +// float3 Grad = J[0].xyz; // gradient of J[0].w +// float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]); +// float Div = J[0][0]+J[1][1]+J[2][2]; +// All of these are confirmed to compile out all unneeded terms. +// So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation. +float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize) +{ + int3 MGradientMask = int3(0x8000, 0x4000, 0x2000); + float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000); + + // corners of tetrahedron + float4x3 T = SimplexCorners(v); + // TODO: uint3 + int3 rand = int3(0); + float4x3 gvec0 = float4x3(1.0); + float4x3 gvec1 = float4x3(1.0); + float4x3 gvec2 = float4x3(1.0); + float4x3 fv = float4x3(1.0); + float3x4 grad = float3x4(1.0); + + // processing of tetrahedral vertices, unrolled + // to compute gradient at each corner + fv[0] = v - T[0]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize)))); + gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][0] = math::dot(gvec0[0], fv[0]); + grad[1][0] = math::dot(gvec1[0], fv[0]); + grad[2][0] = math::dot(gvec2[0], fv[0]); + + fv[1] = v - T[1]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize)))); + gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][1] = math::dot(gvec0[1], fv[1]); + grad[1][1] = math::dot(gvec1[1], fv[1]); + grad[2][1] = math::dot(gvec2[1], fv[1]); + + fv[2] = v - T[2]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize)))); + gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][2] = math::dot(gvec0[2], fv[2]); + grad[1][2] = math::dot(gvec1[2], fv[2]); + grad[2][2] = math::dot(gvec2[2], fv[2]); + + fv[3] = v - T[3]; + rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize)))); + gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1; + gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1; + gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1; + grad[0][3] = math::dot(gvec0[3], fv[3]); + grad[1][3] = math::dot(gvec1[3], fv[3]); + grad[2][3] = math::dot(gvec2[3], fv[3]); + + // blend gradients + float4 sv = SimplexSmooth(fv); + float3x4 ds = SimplexDSmooth(fv); + + float3x4 jacobian = float3x4(1.0); + float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major) + jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0])); + float3 vec1 = gvec1*sv + grad[1]*ds; + jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1])); + float3 vec2 = gvec2*sv + grad[2]*ds; + jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2])); + + return jacobian; +} + +// While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes +// floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion. +float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize) +{ + // verified, HLSL compiled out the switch if Function is a constant + switch(Function) + { + case 0: + return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position); + case 1: + return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize); + case 2: + return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position); + case 3: + return GradientNoise3D_ALU(Position, bTiling, RepeatSize); + case 4: + return ValueNoise3D_ALU(Position, bTiling, RepeatSize); + case 5: + return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0; + } + return 0; +} +//---------------------------------------------------------- + +export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize) +[[ + anno::description("Noise"), + anno::noinline() +]] +{ + Position *= Scale; + FilterWidth *= Scale; + + float Out = 0.0f; + float OutScale = 1.0f; + float InvLevelScale = 1.0f / LevelScale; + + int iFunction(Function); + int iQuality(Quality); + int iLevels(Levels); + bool bTurbulence(Turbulence); + bool bTiling(Tiling); + + for(int i = 0; i < iLevels; ++i) + { + // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions) + OutScale *= math::saturate(1.0 - FilterWidth); + + if(bTurbulence) + { + Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale; + } + else + { + Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale; + } + + Position *= LevelScale; + RepeatSize *= LevelScale; + OutScale *= InvLevelScale; + FilterWidth *= LevelScale; + } + + if(!bTurbulence) + { + // bring -1..1 to 0..1 range + Out = Out * 0.5f + 0.5f; + } + + // Out is in 0..1 range + return math::lerp(OutputMin, OutputMax, Out); +} + +// Material node for noise functions returning a vector value +// @param LevelScale usually 2 but higher values allow efficient use of few levels +// @return in user defined range (OutputMin..OutputMax) +export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise"), + anno::noinline() +]] +{ + float4 result = float4(0,0,0,1); + float3 ret = float3(0); + int iQuality = int(Quality); + int iFunction = int(Function); + bool bTiling = Tiling > 0.0; + + float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used + + // verified, HLSL compiled out the switch if Function is a constant + switch (iFunction) + { + case 0: // Cellnoise + ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff; + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 1: // Color noise + ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 2: // Gradient + result = Jacobian[0]; + break; + case 3: // Curl + ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]); + result = float4(ret.x, ret.y, ret.z, 1); + break; + case 4: // Voronoi + result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false); + break; + } + return result; +} + +export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize) +[[ + anno::description("Vector Noise float3 version"), + anno::noinline() +]] +{ + float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize); + return float3(noise.x, noise.y, noise.z); +} + + +// workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view +export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]]) +[[ + anno::description("Fresnel"), + anno::noinline() +]] +{ + return 0.0; +} + +export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]], + bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]], + bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]], + bool clamp_fresnel_dot_product [[anno::unused()]]) +[[ + anno::description("Fresnel Function"), + anno::noinline() +]] +{ + return 0.0; +} + +export float3 camera_vector(uniform bool up_z = true) +[[ + anno::description("Camera Vector"), + anno::noinline() +]] +{ + // assume camera postion is 0,0,0 + return math::normalize(float3(0) - convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)); +} + +export float pixel_depth() +[[ + anno::description("Pixel Depth"), + anno::noinline() +]] +{ + return 256.0f; +} + +export float scene_depth() +[[ + anno::description("Scene Depth") +]] +{ + return 65500.0f; +} + +export float3 scene_color() +[[ + anno::description("Scene Color") +]] +{ + return float3(1.0f); +} + +export float4 vertex_color() +[[ + anno::description("Vertex Color"), + anno::noinline() +]] +{ + return float4(1.0f); +} + +export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex) +[[ + anno::description("Vertex Color for float2 PrimVar"), + anno::noinline() +]] +{ + // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead + return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y); +} + +export float3 camera_position() +[[ + anno::description("Camera Position"), + anno::noinline() +]] +{ + return float3(1000.0f, 0, 0); +} + +export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position) +[[ + anno::description("Rotates Position about the given axis by the given angle") +]] +{ + // Project Position onto the rotation axis and find the closest point on the axis to Position + float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z); + float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis); + // Construct orthogonal axes in the plane of the rotation + float3 UAxis = Position - ClosestPointOnAxis; + float3 VAxis = math::cross(NormalizedRotationAxis, UAxis); + float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w); + // Rotate using the orthogonal axes + float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0]; + // Reconstruct the rotated world space position + float3 RotatedPosition = ClosestPointOnAxis + R; + // Convert from position to a position offset + return RotatedPosition - Position; +} + +export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset) +[[ + anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied") +]] +{ + return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset; +} + +export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal, uniform bool up_z = true) +[[ + anno::description("Reflection vector about the specified world space normal") +]] +{ + if (bNormalizeInputNormal) + { + WorldNormal = math::normalize(WorldNormal); + } + + return -camera_vector(up_z) + WorldNormal * math::dot(WorldNormal, camera_vector(up_z)) * 2.0; +} + +export float3 reflection_vector(uniform bool up_z = true) +[[ + anno::description("Reflection Vector"), + anno::noinline() +]] +{ + float3 normal = convert_to_left_hand(state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal()), up_z, false); + return reflection_custom_world_normal(normal, false, up_z); +} + +export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]]) +[[ + anno::description("Dither TemporalAA"), + anno::noinline() +]] +{ + return AlphaThreshold; +} + +export float3 black_body( float Temp ) +[[ + anno::description("Black Body"), + anno::noinline() +]] +{ + float u = ( 0.860117757f + 1.54118254e-4f * Temp + 1.28641212e-7f * Temp*Temp ) / ( 1.0f + 8.42420235e-4f * Temp + 7.08145163e-7f * Temp*Temp ); + float v = ( 0.317398726f + 4.22806245e-5f * Temp + 4.20481691e-8f * Temp*Temp ) / ( 1.0f - 2.89741816e-5f * Temp + 1.61456053e-7f * Temp*Temp ); + + float x = 3*u / ( 2*u - 8*v + 4 ); + float y = 2*v / ( 2*u - 8*v + 4 ); + float z = 1 - x - y; + + float Y = 1; + float X = Y/y * x; + float Z = Y/y * z; + + float3x3 XYZtoRGB = float3x3( + float3(3.2404542, -1.5371385, -0.4985314), + float3(-0.9692660, 1.8760108, 0.0415560), + float3(0.0556434, -0.2040259, 1.0572252) + ); + + return XYZtoRGB * float3( X, Y, Z ) * math::pow( 0.0004 * Temp, 4 ); +} + +export float per_instance_random(uniform texture_2d PerlinNoiseGradientTexture, int NumberInstances) +[[ + anno::description("Per Instance Random"), + anno::noinline() +]] +{ + float weight = state::object_id() / float(NumberInstances); + return NumberInstances == 0 ? 0.0 : tex::lookup_float4(PerlinNoiseGradientTexture, float2(weight, 1.0 - weight), tex::wrap_repeat, tex::wrap_repeat).x; +} + +//------------------ Hair from UE4 ----------------------- +float3 hair_absorption_to_color(float3 A) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::exp(-math::sqrt(A) * D); +} + +float3 hair_color_to_absorption(float3 C) +{ + const float B = 0.3f; + float b2 = B * B; + float b3 = B * b2; + float b4 = b2 * b2; + float b5 = B * b4; + float D = (5.969f - 0.215f * B + 2.532f * b2 - 10.73f * b3 + 5.574f * b4 + 0.245f * b5); + return math::pow(math::log(C) / D, 2.0f); +} + +export float3 get_hair_color_from_melanin(float InMelanin, float InRedness, float3 InDyeColor) +[[ + anno::description("Hair Color") +]] +{ + InMelanin = math::saturate(InMelanin); + InRedness = math::saturate(InRedness); + float Melanin = -math::log(math::max(1 - InMelanin, 0.0001f)); + float Eumelanin = Melanin * (1 - InRedness); + float Pheomelanin = Melanin * InRedness; + + float3 DyeAbsorption = hair_color_to_absorption(math::saturate(InDyeColor)); + float3 Absorption = Eumelanin * float3(0.506f, 0.841f, 1.653f) + Pheomelanin * float3(0.343f, 0.733f, 1.924f); + + return hair_absorption_to_color(Absorption + DyeAbsorption); +} + +export float3 local_object_bounds_min() +[[ + anno::description("Local Object Bounds Min"), + anno::noinline() +]] +{ + return float3(0.0); +} + +export float3 local_object_bounds_max() +[[ + anno::description("Local Object Bounds Max"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float3 object_bounds() +[[ + anno::description("Object Bounds"), + anno::noinline() +]] +{ + return float3(100.0); +} + +export float object_radius() +[[ + anno::description("Object Radius"), + anno::noinline() +]] +{ + return 100.0f; +} + +export float3 object_world_position(uniform bool up_z = true) +[[ + anno::description("Object World Position"), + anno::noinline() +]] +{ + return convert_to_left_hand(state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()), up_z)*state::meters_per_scene_unit()*100.0; +} + +export float3 object_orientation() +[[ + anno::description("Object Orientation"), + anno::noinline() +]] +{ + return float3(0); +} + +export float rcp(float x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float2 rcp(float2 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float3 rcp(float3 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export float4 rcp(float4 x) +[[ + anno::description("hlsl rcp"), + anno::noinline() +]] +{ + return 1.0f / x; +} + +export int BitFieldExtractI32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractI32 int"), + anno::noinline() +]] +{ + Size &= 3; + Offset &= 3; + + if (Size == 0) + return 0; + else if (Offset + Size < 32) + return (Data << (32 - Size - Offset)) >> (32 - Size); + else + return Data >> Offset; +} + +export int BitFieldExtractI32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractI32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(int(Data), int(Size), int(Offset)); +} + +export int BitFieldExtractU32(float Data, float Size, float Offset) +[[ + anno::description("BitFieldExtractU32 float"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export int BitFieldExtractU32(int Data, int Size, int Offset) +[[ + anno::description("BitFieldExtractU32 int"), + anno::noinline() +]] +{ + return BitFieldExtractI32(Data, Size, Offset); +} + +export float3 EyeAdaptationInverseLookup(float3 LightValue, float Alpha) +[[ + anno::description("EyeAdaptationInverseLookup"), + anno::noinline() +]] +{ + float Adaptation = 1.0f; + + // When Alpha=0.0, we want to multiply by 1.0. when Alpha = 1.0, we want to multiply by 1/Adaptation. + // So the lerped value is: + // LerpLogScale = Lerp(log(1),log(1/Adaptaiton),T) + // Which is simplified as: + // LerpLogScale = Lerp(0,-log(Adaptation),T) + // LerpLogScale = -T * logAdaptation; + + float LerpLogScale = -Alpha * math::log(Adaptation); + float Scale = math::exp(LerpLogScale); + return LightValue * Scale; +} diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Archinteriors7_10_15.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Archinteriors7_10_15.mdl new file mode 100644 index 0000000000000000000000000000000000000000..68e3bfe636cdccde23577a01f902a75787ca03ce --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Archinteriors7_10_15.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Archinteriors7_10_15() +[[ + anno::display_name("Archinteriors7_10_15") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(1.0,1.0,1.0), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0,0.0,0.0), mono:1), + color2 : base::texture_return(tint:color(0.74902,0.839216,1.0), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Fresnel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.85f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_10.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_10.mdl new file mode 100644 index 0000000000000000000000000000000000000000..25446c0da6aa79407a9c0857d05a2aa4cc5d8dcf --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_10.mdl @@ -0,0 +1,123 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Cover_10() +[[ + anno::display_name("Cover_10") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Cover_10/3d66Model-515679-11-5.JPG", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Cover_10/3d66Model-515679-2-5.JPG", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_101.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_101.mdl new file mode 100644 index 0000000000000000000000000000000000000000..89e2b7eb4278cd600eeac5c67882a57bed44e78f --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_101.mdl @@ -0,0 +1,123 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Cover_101() +[[ + anno::display_name("Cover_101") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Cover_101/3d66Model-515677-12-12.JPG", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Cover_101/3d66Model-515677-2-12.JPG", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_15.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_15.mdl new file mode 100644 index 0000000000000000000000000000000000000000..0722eee3fa6d79530677a33ce376d25883b6085f --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_15.mdl @@ -0,0 +1,123 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Cover_15() +[[ + anno::display_name("Cover_15") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Cover_15/3d66Model-515679-17-5.JPG", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Cover_15/3d66Model-515679-13-5.JPG", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + reflection_glossiness : 0.7f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_81.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_81.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2c42aebd5346b309dc9e5c5bf028f44b415774f0 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Cover_81.mdl @@ -0,0 +1,123 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Cover_81() +[[ + anno::display_name("Cover_81") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Cover_81/3d66Model-515677-10-12.JPG", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Cover_81/3d66Model-515677-2-12.JPG", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + reflection_glossiness : 0.8f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_541397_292_8586.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_541397_292_8586.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c7c8663c8ab184e54a012acfd9569b1ab8e5f2f7 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_541397_292_8586.mdl @@ -0,0 +1,67 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::in_group; +import ::anno::key_words; +import ::anno::version; +import ::base::mono_mode; +import ::tex::gamma_mode; + +export material Mat3d66_541397_292_8586(*) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base", false), + anno::version(2, 1, 2, ""), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = OmniPBR::OmniPBR( + diffuse_color_constant: color(0.5f, 0.5f, 0.5f), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(0.f, 0.f, 0.f), + emissive_color_texture: texture_2d(), + emissive_mask_texture: texture_2d(), + emissive_intensity: 3250.f, + enable_opacity: false, + opacity_texture: texture_2d(), + opacity_constant: 1.f, + enable_opacity_texture: false, + opacity_mode: base::mono_average, + opacity_threshold: 0.00100000005f, + geometry_normal_roughness_strength: 1.f, + bump_factor: 0.300000012f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + flip_tangent_u: false, + flip_tangent_v: true, + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_717112_11_510.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_717112_11_510.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b5c9d15a758260ede97344cf95ab2f117ebfe3f6 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_717112_11_510.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_717112_11_510() +[[ + anno::display_name("Mat3d66_717112_11_510") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0117647,0.0117647,0.0117647), + diffuse_roughness : 0.0f, + Reflection : color(0.0196078,0.0196078,0.0196078), + reflection_glossiness : 0.9f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_717112_5_8480.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_717112_5_8480.mdl new file mode 100644 index 0000000000000000000000000000000000000000..252beb55385a59c70cb384dd449bc62229979db7 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_717112_5_8480.mdl @@ -0,0 +1,97 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_717112_5_8480() +[[ + anno::display_name("Mat3d66_717112_5_8480") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.337255,0.337255,0.337255) * 0.1 + color(0.337255,0.337255,0.337255) * 0.9, + diffuse_roughness : 0.0f, + Reflection : color(0.368627,0.368627,0.368627) * 0.2 + color(0.368627,0.368627,0.368627) * 0.8, + reflection_glossiness : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./Mat3d66_717112_5_8480/3d66Model-717112-files-3.jpg", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).mono * 0.3 + 0.95f * 0.7, + reflection_fresnel : false, + reflection_ior : 2.0f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ward, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_952066_39_3608.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_952066_39_3608.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b951308c6fc2f4ea1ee4b53c0f92869e9bd72642 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_952066_39_3608.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_952066_39_3608() +[[ + anno::display_name("Mat3d66_952066_39_3608") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.737255,0.737255,0.737255), + diffuse_roughness : 0.0f, + Reflection : color(0.580392,0.580392,0.580392), + reflection_glossiness : 0.65f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_952066_8_4218.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_952066_8_4218.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1dd90d562ce2c541fa74e94cd694a1b1c83231ae --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Mat3d66_952066_8_4218.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Mat3d66_952066_8_4218() +[[ + anno::display_name("Mat3d66_952066_8_4218") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0666667,0.2,1.0), + diffuse_roughness : 0.0f, + Reflection : color(0.0980392,0.0980392,0.0980392), + reflection_glossiness : 0.95f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8c09817da1c41cb2513b532cf0d9d6ecab3bc460 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__2() +[[ + anno::display_name("Material__2") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.941177,0.941177,0.941177), + diffuse_roughness : 0.0f, + Reflection : color(0.117647,0.117647,0.117647), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__21.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__21.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e4d25e2fb5db5d04018618f3358758ecb7459b6f --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__21.mdl @@ -0,0 +1,96 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__21() +[[ + anno::display_name("Material__21") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.72549,0.72549,0.72549) * 0.2 + color(0.72549,0.72549,0.72549) * 0.8, + diffuse_roughness : 0.0f, + Reflection : color(0.768628,0.768628,0.768628), + reflection_glossiness : 0.75f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(0.0,0.0,0.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_phong, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_noise_bump( + color1 : color(0.0,0.0,0.0), + color2 : color(1.0,1.0,1.0), + size : 0.005f, + phase : 0.0f, + levels : 3.0f, + thresholdLow : 0.0f, + thresholdHigh : 1.0f, + type : 1, + blur : 1.0f, + offset : float3(0.0f,0.0f,0.0f), + tiling : float3(0.0393701f,0.0f,0.0393701f), + angle : float3(0.0f,0.0f,0.0f), + blur_Offset : 0.0f, + coordType : 0, + mapChannel : 1, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.3f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2100438534.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2100438534.mdl new file mode 100644 index 0000000000000000000000000000000000000000..931e1bfdd874b43362ec4217c7fd54ddc9358b7c --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2100438534.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__2100438534() +[[ + anno::display_name("Material__2100438534") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.839216,0.866667,0.882353), + diffuse_roughness : 0.0f, + Reflection : color(0.172549,0.172549,0.172549), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.913726,0.913726,0.913726), + refraction_glossiness : 1.0f, + refraction_ior : 1.517f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2146023331.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2146023331.mdl new file mode 100644 index 0000000000000000000000000000000000000000..40c5a6eb373a71253b557088adb5edb5ac741c65 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2146023331.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__2146023331() +[[ + anno::display_name("Material__2146023331") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.184314,0.317647,0.498039), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 0.3f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2147456274.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2147456274.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1dbd20e1c20f90aef0bf046e302eb5d17eda0cbe --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2147456274.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__2147456274() +[[ + anno::display_name("Material__2147456274") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.156863,0.156863,0.156863), + diffuse_roughness : 0.0f, + Reflection : color(1.0,1.0,1.0), + reflection_glossiness : 0.9f, + reflection_fresnel : true, + reflection_ior : 2.2f, + reflection_lockIOR : false, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2147456304.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2147456304.mdl new file mode 100644 index 0000000000000000000000000000000000000000..5952684a64e88077d369a42e6e98756886bbefd7 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/Material__2147456304.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material Material__2147456304() +[[ + anno::display_name("Material__2147456304") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.658824,0.658824,0.658824), + diffuse_roughness : 0.0f, + Reflection : color(0.105882,0.105882,0.105882), + reflection_glossiness : 0.95f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a03___Defaultggg.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a03___Defaultggg.mdl new file mode 100644 index 0000000000000000000000000000000000000000..3fccf9f6ae95e706a3e590a221e96c42a86d2771 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a03___Defaultggg.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a03___Defaultggg() +[[ + anno::display_name("_03___Defaultggg") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0509804,0.0509804,0.0509804), + diffuse_roughness : 0.0f, + Reflection : color(0.705882,0.705882,0.705882), + reflection_glossiness : 0.95f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a06___wrqDefault.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a06___wrqDefault.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d348783c46211190e555ca4409d6a6227e719cf0 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a06___wrqDefault.mdl @@ -0,0 +1,40 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a06___wrqDefault() +[[ + anno::display_name("_06___wrqDefault") +]] += ::templates::vray_materials::VRayLightMtl( + emission : color(1.0,1.0,1.0), + emission_mult : 3750.0f, + opacity : color(1.0,1.0,1.0), + emit_on_backside : false, + mult_emission_by_opacity : false, + displacement : 0.0f, + displace_amnt : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a11___Default1.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a11___Default1.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e8e30e712a9767408f751ba0621e271f8569468b --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a11___Default1.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a11___Default1() +[[ + anno::display_name("_11___Default1") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.243137,0.243137,0.243137), + diffuse_roughness : 0.0f, + Reflection : color(0.121569,0.121569,0.121569), + reflection_glossiness : 0.86f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a24___Default_78_78.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a24___Default_78_78.mdl new file mode 100644 index 0000000000000000000000000000000000000000..71f4adc1cca8a156dd6e86f32a7c7d7659b67a77 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a24___Default_78_78.mdl @@ -0,0 +1,41 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; +//Error: [Unknown] parm: emission + +// Body +export material a24___Default_78_78() +[[ + anno::display_name("_24___Default_78_78") +]] += ::templates::vray_materials::VRayLightMtl( + emission : color(1.0,1.0,1.0), + emission_mult : 7500.0f, + opacity : color(1.0,1.0,1.0), + emit_on_backside : false, + mult_emission_by_opacity : false, + displacement : 0.0f, + displace_amnt : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e0a6e1a45ae33ab3d52777b378abe581ebd9ddfb --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____.mdl @@ -0,0 +1,67 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::in_group; +import ::anno::key_words; +import ::anno::version; +import ::base::mono_mode; +import ::tex::gamma_mode; + +export material a_____(*) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base", false), + anno::version(2, 1, 2, ""), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = OmniPBR::OmniPBR( + diffuse_color_constant: color(0.5f, 0.5f, 0.5f), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(0.f, 0.f, 0.f), + emissive_color_texture: texture_2d(), + emissive_mask_texture: texture_2d(), + emissive_intensity: 3250.f, + enable_opacity: false, + opacity_texture: texture_2d(), + opacity_constant: 1.f, + enable_opacity_texture: false, + opacity_mode: base::mono_average, + opacity_threshold: 0.00100000005f, + geometry_normal_roughness_strength: 1.f, + bump_factor: 0.300000012f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + flip_tangent_u: false, + flip_tangent_v: true, + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____14.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____14.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cb5e7e9fd61578a32e8ab7f82f5615f7497f6135 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____14.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a_____14() +[[ + anno::display_name("______14") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.909804,0.909804,0.909804), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0,0.0,0.0), mono:1), + color2 : base::texture_return(tint:color(0.807843,0.894118,1.0), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Fresnel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.82f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____4.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____4.mdl new file mode 100644 index 0000000000000000000000000000000000000000..9ce82abe619332f078201f776145645c4ab99bbd --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____4.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a_____4() +[[ + anno::display_name("______4") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.901961,0.901961,0.901961), + diffuse_roughness : 0.0f, + Reflection : color(0.784314,0.784314,0.784314), + reflection_glossiness : 0.9f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____4232.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____4232.mdl new file mode 100644 index 0000000000000000000000000000000000000000..1a368a26bae64de598bdee38fc8613a8509ae99f --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____4232.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a_____4232() +[[ + anno::display_name("______4232") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(1.0,1.0,1.0), + diffuse_roughness : 0.0f, + Reflection : color(0.290196,0.290196,0.290196), + reflection_glossiness : 0.98f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____5.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____5.mdl new file mode 100644 index 0000000000000000000000000000000000000000..f5ab66e410d4d74d26c3cfd2b9cdaf0ab227779c --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____5.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a_____5() +[[ + anno::display_name("______5") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0784314,0.0784314,0.0784314), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.0,0.0,0.0), mono:1), + color2 : base::texture_return(tint:color(0.65098,0.807843,1.0), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Fresnel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.7f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____7.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____7.mdl new file mode 100644 index 0000000000000000000000000000000000000000..e5ec8031d3db817f78f4ebb247c8ee8851602336 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____7.mdl @@ -0,0 +1,78 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a_____7() +[[ + anno::display_name("______7") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.552941,0.552941,0.552941), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.25098,0.25098,0.25098), mono:1), + color2 : base::texture_return(tint:color(0.25098,0.25098,0.25098), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Perpendicular_Parallel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + refraction_glossiness : 1.0f, + refraction_ior : 1.0f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____Y.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____Y.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cbf983376719764a07b65a7f9c6bba1d0f62df81 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____Y.mdl @@ -0,0 +1,67 @@ +mdl 1.8; + +import ::state::normal; +import ::OmniPBR::OmniPBR; +import ::anno::author; +import ::anno::description; +import ::anno::display_name; +import ::anno::in_group; +import ::anno::key_words; +import ::anno::version; +import ::base::mono_mode; +import ::tex::gamma_mode; + +export material a_____Y(*) +[[ + anno::display_name("OmniPBR"), + anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."), + anno::in_group("Base", false), + anno::version(2, 1, 2, ""), + anno::author("NVIDIA CORPORATION"), + anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic")) +]] + = OmniPBR::OmniPBR( + diffuse_color_constant: color(0.5f, 0.5f, 0.5f), + diffuse_texture: texture_2d(), + albedo_desaturation: 0.f, + albedo_add: 0.f, + albedo_brightness: 1.f, + diffuse_tint: color(1.f, 1.f, 1.f), + reflection_roughness_constant: 0.f, + reflection_roughness_texture_influence: 0.f, + reflectionroughness_texture: texture_2d(), + metallic_constant: 0.f, + metallic_texture_influence: 0.f, + metallic_texture: texture_2d(), + specular_level: 0.5f, + enable_ORM_texture: false, + ORM_texture: texture_2d(), + ao_to_diffuse: 0.f, + ao_texture: texture_2d(), + enable_emission: true, + emissive_color: color(0.f, 0.f, 0.f), + emissive_color_texture: texture_2d(), + emissive_mask_texture: texture_2d(), + emissive_intensity: 3250.f, + enable_opacity: false, + opacity_texture: texture_2d(), + opacity_constant: 1.f, + enable_opacity_texture: false, + opacity_mode: base::mono_average, + opacity_threshold: 0.00100000005f, + geometry_normal_roughness_strength: 1.f, + bump_factor: 0.300000012f, + normalmap_texture: texture_2d(), + detail_bump_factor: 0.300000012f, + detail_normalmap_texture: texture_2d(), + flip_tangent_u: false, + flip_tangent_v: true, + project_uvw: false, + world_or_object: false, + uv_space_index: 0, + texture_translate: float2(0.f), + texture_rotate: 0.f, + texture_scale: float2(1.f), + detail_texture_translate: float2(0.f), + detail_texture_rotate: 0.f, + detail_texture_scale: float2(1.f)); diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a________2.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a________2.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8b912c93e32dd1dc8b968148bf9f514dac5ae060 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a________2.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a________2() +[[ + anno::display_name("_________2") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0,0.0,0.0), + diffuse_roughness : 0.0f, + Reflection : color(1.0,1.0,1.0), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a________223.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a________223.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b33e92d73c5e8f8ae99b4074af01d34d6f22a82f --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a________223.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a________223() +[[ + anno::display_name("_________223") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.580392,0.580392,0.580392), + diffuse_roughness : 0.0f, + Reflection : color(0.823529,0.823529,0.823529), + reflection_glossiness : 0.88f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.3f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a___________.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a___________.mdl new file mode 100644 index 0000000000000000000000000000000000000000..8b4433995e46223ac1fe54a3098302831ac97af4 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a___________.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a___________() +[[ + anno::display_name("____________") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.894118,0.894118,0.894118), + diffuse_roughness : 0.0f, + Reflection : color(0.603922,0.603922,0.603922), + reflection_glossiness : 0.55f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a____________.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a____________.mdl new file mode 100644 index 0000000000000000000000000000000000000000..788bd765291248efd2c6f946690d9bbb4556f705 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a____________.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a____________() +[[ + anno::display_name("_____________") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(1.0,1.0,1.0), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_________________.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_________________.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d973236794fa432b317c7f3cf2170706b0d5ffcc --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_________________.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a_________________() +[[ + anno::display_name("__________________") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.172549,0.172549,0.172549), + diffuse_roughness : 0.0f, + Reflection : color(0.458824,0.458824,0.458824), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.117647,0.117647,0.117647), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____e4rrt.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____e4rrt.mdl new file mode 100644 index 0000000000000000000000000000000000000000..d84e55a67baf0f95434c5021b4eb6f6ccd800cb7 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____e4rrt.mdl @@ -0,0 +1,157 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a_____e4rrt() +[[ + anno::display_name("______e4rrt") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./a_____e4rrt/微信图片_20190227173526.png", ::tex::gamma_srgb), + cliph : 0.826573f, + clipu : 0.048433f, + clipv : 0.0475525f, + clipw : 0.851852f, + mono_output : ::templates::ad_3dsmax_maps::mono_output_rgb_intensity, + rgb_output : ::templates::ad_3dsmax_maps::rgb_output_rgb, + alpha_source : ::templates::ad_3dsmax_maps::alpha_source_none, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./a_____e4rrt/微信图片_20190227173526.png", ::tex::gamma_srgb), + cliph : 0.826573f, + clipu : 0.048433f, + clipv : 0.0475525f, + clipw : 0.851852f, + mono_output : ::templates::ad_3dsmax_maps::mono_output_rgb_intensity, + rgb_output : ::templates::ad_3dsmax_maps::rgb_output_rgb, + alpha_source : ::templates::ad_3dsmax_maps::alpha_source_none, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint * 0.2 + color(0.0,0.0,0.0) * 0.8, + reflection_glossiness : 0.6f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap_bump( + filename : texture_2d("./a_____e4rrt/微信图片_20190227173526.png", ::tex::gamma_srgb), + cliph : 0.826573f, + clipu : 0.048433f, + clipv : 0.0475525f, + clipw : 0.851852f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.1f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____e4rrtwed3.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____e4rrtwed3.mdl new file mode 100644 index 0000000000000000000000000000000000000000..cb97635d0710e4c621e0725bb74c5cf127886472 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/a_____e4rrtwed3.mdl @@ -0,0 +1,157 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material a_____e4rrtwed3() +[[ + anno::display_name("______e4rrtwed3") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./a_____e4rrtwed3/微信图片_20190227173513.png", ::tex::gamma_srgb), + cliph : 0.826573f, + clipu : 0.048433f, + clipv : 0.0475525f, + clipw : 0.851852f, + mono_output : ::templates::ad_3dsmax_maps::mono_output_rgb_intensity, + rgb_output : ::templates::ad_3dsmax_maps::rgb_output_rgb, + alpha_source : ::templates::ad_3dsmax_maps::alpha_source_none, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./a_____e4rrtwed3/微信图片_20190227173513.png", ::tex::gamma_srgb), + cliph : 0.826573f, + clipu : 0.048433f, + clipv : 0.0475525f, + clipw : 0.851852f, + mono_output : ::templates::ad_3dsmax_maps::mono_output_rgb_intensity, + rgb_output : ::templates::ad_3dsmax_maps::rgb_output_rgb, + alpha_source : ::templates::ad_3dsmax_maps::alpha_source_none, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint * 0.2 + color(0.0,0.0,0.0) * 0.8, + reflection_glossiness : 0.6f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_bump : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap_bump( + filename : texture_2d("./a_____e4rrtwed3/微信图片_20190227173513.png", ::tex::gamma_srgb), + cliph : 0.826573f, + clipu : 0.048433f, + clipv : 0.0475525f, + clipw : 0.851852f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f, + factor : 0.1f + ), + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/fdgault.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/fdgault.mdl new file mode 100644 index 0000000000000000000000000000000000000000..39b71924c05eb811ef231a8e769d2eb66f568d5d --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/fdgault.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material fdgault() +[[ + anno::display_name("fdgault") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.0509804,0.0509804,0.0509804), + diffuse_roughness : 0.0f, + Reflection : color(0.662745,0.662745,0.662745), + reflection_glossiness : 0.97f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/gg.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/gg.mdl new file mode 100644 index 0000000000000000000000000000000000000000..34b6cf25e2ecbbd8b614c814896cdfead88d7540 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/gg.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material gg() +[[ + anno::display_name("gg") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.184314,0.184314,0.184314), + diffuse_roughness : 0.0f, + Reflection : color(0.921569,0.917647,0.909804), + reflection_glossiness : 0.98f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ggx, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.5f, + anisotropy_rotation : 20.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/pages_5.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/pages_5.mdl new file mode 100644 index 0000000000000000000000000000000000000000..2a6919dc689e44efbba2da72e9d971cdc20651ed --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/pages_5.mdl @@ -0,0 +1,97 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material pages_5() +[[ + anno::display_name("pages_5") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./pages_5/3d66Model-515679-32-5.JPG", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/pages_6.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/pages_6.mdl new file mode 100644 index 0000000000000000000000000000000000000000..555580e1d0e10c3bff41b55e8e8087c3c2fd21a4 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/pages_6.mdl @@ -0,0 +1,97 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material pages_6() +[[ + anno::display_name("pages_6") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./pages_6/3d66Model-515679-33-5.JPG", ::tex::gamma_srgb), + cliph : 1.0f, + clipu : 0.0f, + clipv : 0.0f, + clipw : 1.0f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/pvc.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/pvc.mdl new file mode 100644 index 0000000000000000000000000000000000000000..c2cb690ae4e4bfb6ce11d2d686ea11fbe70128bf --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/pvc.mdl @@ -0,0 +1,85 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material pvc() +[[ + anno::display_name("pvc") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(1.0,1.0,1.0), + diffuse_roughness : 0.0f, + Reflection : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(0.164706,0.164706,0.164706), mono:1), + color2 : base::texture_return(tint:color(0.498039,0.498039,0.498039), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Fresnel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + reflection_glossiness : 0.9f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : ::templates::ad_3dsmax_maps::ad_3dsmax_falloff( + color1 : base::texture_return(tint:color(1.0,1.0,1.0), mono:1), + color2 : base::texture_return(tint:color(0.0,0.0,0.0), mono:1), + falloff_type : ::templates::ad_3dsmax_maps::Fresnel, + falloff_direction : ::templates::ad_3dsmax_maps::View, + nearDistance : 0.0f, + farDistance : 100.0f + ).tint, + refraction_glossiness : 1.0f, + refraction_ior : 1.0f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 0.1f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 0.5f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_ward, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/ssss11ds11ssEssff.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/ssss11ds11ssEssff.mdl new file mode 100644 index 0000000000000000000000000000000000000000..7c9ccdff64f0d9febf326ecb3dc5d04a500914be --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/ssss11ds11ssEssff.mdl @@ -0,0 +1,97 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material ssss11ds11ssEssff() +[[ + anno::display_name("ssss11ds11ssEssff") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : ::templates::ad_3dsmax_maps::ad_3dsmax_bitmap( + filename : texture_2d("./ssss11ds11ssEssff/u=42624830,2232020750&fm=26&gp=0.jpg", ::tex::gamma_srgb), + cliph : 0.439328f, + clipu : 0.529778f, + clipv : 0.0283721f, + clipw : 0.440222f, + mapChannel : 1, + U_angle : 0.0f, + U_Mirror : false, + U_Offset : 0.0f, + U_Tile : true, + U_Tiling : 1.0f, + UVW_Type : 0, + V_angle : 0.0f, + V_Mirror : false, + V_Offset : 0.0f, + V_Tile : true, + V_Tiling : 1.0f, + W_angle : 0.0f, + alphaFromRGB : false, + bump_amount : 1.0f, + clamp : false, + invert : false, + output_amount : 1.0f, + rgb_level : 1.0f, + rgb_offset : 0.0f + ).tint, + diffuse_roughness : 0.0f, + Reflection : color(0.0588235,0.0588235,0.0588235), + reflection_glossiness : 0.75f, + reflection_fresnel : false, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/vray_Material__26.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/vray_Material__26.mdl new file mode 100644 index 0000000000000000000000000000000000000000..b5e27ac0655742073d05eb3a89e2846e19796e40 --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/vray_Material__26.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material vray_Material__26() +[[ + anno::display_name("vray_Material__26") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.588,0.588,0.588), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + + diff --git a/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/vray_Material__28.mdl b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/vray_Material__28.mdl new file mode 100644 index 0000000000000000000000000000000000000000..23b9b849bf336ad3a11ecf0f257792007f6e824f --- /dev/null +++ b/assets/scene_usds/ebench/teleop_tasks/tighten_nut/merge_usd/0013/Materials/vray_Material__28.mdl @@ -0,0 +1,71 @@ +///\authors: Auto-generated by vray_to_mdl_export.ms script. +///\description: Translated VRay material. + +mdl 1.6; + +// Import +import ::anno::*; +import ::base::transform_coordinate; +import ::base::rotation_translation_scale; +import ::base::file_texture; +import ::base::mono_mode; +import ::base::texture_coordinate_info; +import ::base::texture_return; +import ::state::normal; +import ::state::texture_coordinate; +import ::state::texture_tangent_u; +import ::state::texture_tangent_v; +import ::tex::gamma_mode; +import ::tex::wrap_mode; +import templates::ad_3dsmax_materials::*; +import templates::ad_3dsmax_maps::*; +import templates::vray_materials::*; +import templates::vray_maps::*; + +// Body +export material vray_Material__28() +[[ + anno::display_name("vray_Material__28") +]] += ::templates::vray_materials::VRayMtl( + Diffuse : color(0.588,0.588,0.588), + diffuse_roughness : 0.0f, + Reflection : color(0.0,0.0,0.0), + reflection_glossiness : 1.0f, + reflection_fresnel : true, + reflection_ior : 1.6f, + reflection_lockIOR : true, + invert_reflection_ior : false, + reflection_metalness : 0.0f, + Refraction : color(0.0,0.0,0.0), + refraction_glossiness : 1.0f, + refraction_ior : 1.6f, + invert_refraction_ior : false, + refraction_dispersion_on : false, + refraction_dispersion : 50.0f, + refraction_fogColor : color(1.0,1.0,1.0), + refraction_fogBias : 0.0f, + refraction_fogMult : 1.0f, + translucency_on : ::templates::vray_materials::translucency_none, + translucency_scatterCoeff : 0.0f, + translucency_fbCoeff : 1.0f, + translucency_color : color(1.0,1.0,1.0), + self_illumination : color(0.0,0.0,0.0), + self_illumination_multiplier : 1.0f, + coat_amount : 0.0f, + coat_color : color(1.0,1.0,1.0), + coat_glossiness : 1.0f, + coat_ior : 1.6f, + invert_coat_ior : false, + coat_bump_lock : false, + sheen_color : color(0.0,0.0,0.0), + sheen_glossiness : 0.8f, + brdf_type : ::templates::vray_materials::brdf_blinn, + brdf_useRoughness : ::templates::vray_materials::brdf_glossiness, + anisotropy : 0.0f, + anisotropy_rotation : 0.0f, + anisotropy_channel : 1, + texmap_opacity : 1.0f +); + +