| mdl 1.6; | |
| import ::math::*; | |
| import ::state::*; | |
| import ::tex::*; | |
| import ::anno::*; | |
| import ::scene::*; | |
| 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 MI_Scanner( | |
| float Tile = 1.0 | |
| [[ | |
| anno::display_name("Tile"), | |
| anno::ui_order(32), | |
| anno::in_group("Textures") | |
| ]], | |
| uniform texture_2d Normal = texture_2d("./MI_Scanner/T_Scanner_N.png",::tex::gamma_linear) | |
| [[ | |
| anno::display_name("Normal"), | |
| anno::ui_order(32), | |
| anno::in_group("Textures"), | |
| sampler_normal() | |
| ]], | |
| float NormalIntensity = 1.0 | |
| [[ | |
| anno::display_name("Normal Intensity"), | |
| anno::ui_order(32), | |
| anno::in_group("Textures") | |
| ]], | |
| float4 AlbedoColor = float4(1.0,1.0,1.0,1.0) | |
| [[ | |
| anno::display_name("Albedo Color"), | |
| anno::ui_order(32), | |
| anno::in_group("Coloring") | |
| ]], | |
| uniform texture_2d BaseColor = texture_2d("./MI_Scanner/T_Scanner_BC.png",::tex::gamma_srgb) | |
| [[ | |
| anno::display_name("Base Color"), | |
| anno::ui_order(32), | |
| anno::in_group("Textures"), | |
| sampler_color() | |
| ]], | |
| uniform texture_2d RMAM = texture_2d("./MI_Scanner/T_Scanner_RMA.png",::tex::gamma_linear) | |
| [[ | |
| anno::display_name("RMAM"), | |
| anno::ui_order(32), | |
| anno::in_group("Textures"), | |
| sampler_masks() | |
| ]], | |
| 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 * Tile); | |
| float4 Local1 = ::unpack_normal_map(tex::lookup_float4(Normal,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat)); | |
| float Local2 = (1.0 - NormalIntensity); | |
| float3 Local3 = math::lerp(float3(Local1.x,Local1.y,Local1.z),float3(0.0,0.0,1.0),Local2); | |
| float3 Normal_mdl = Local3; | |
| float4 Local4 = tex::lookup_float4(BaseColor,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat); | |
| float3 Local5 = (float3(AlbedoColor.x,AlbedoColor.y,AlbedoColor.z) * float3(Local4.x,Local4.y,Local4.z)); | |
| float4 Local6 = tex::lookup_float4(RMAM,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat); | |
| float3 EmissiveColor_mdl = float3(0.0,0.0,0.0); | |
| float OpacityMask_mdl = 1.0; | |
| float3 BaseColor_mdl = Local5; | |
| float Metallic_mdl = Local6.y; | |
| float Specular_mdl = 0.5; | |
| float Roughness_mdl = Local6.x; | |
| float SurfaceThickness_mdl = 0.01; | |
| float Displacement_mdl = 0.0; | |
| } 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); | |