首先记录提供的现象,因为它们可以满足大多数实际使用。专家用户可以使用这些现象作为模板来创建自己的现象,或使用高级主题中所述的组件着色器。这些现象使用结构来对逻辑组中的输入参数进行分组,这些参数由 mental ray 的不同 OEM 集成的用户界面自动进行分组。
此现象自动(除非明确指定)生成所需的光照贴图,填充光照贴图数据,并使用次表面散射将这些对象作为常规、半透明对象进行着色。散射分为两部分,一部分用于对象的前面,另一部分用于对象的后面。
在某种意义上讲,该着色器的工作方式是,对多个灯光贡献相互分层(请参见 misss_fast_shader)以获得最终结果。记住以下经验规则很重要:
material "misss_fast_simple_phen" ( color texture "lightmap", color texture "depthmap", string "lightmap_group", scalar "lightmap_size", integer "samples", shader "bump", struct "d" { color "ambient", color "overall_color", color "diffuse_color", scalar "diffuse_weight", color "front_sss_color", scalar "front_sss_weight", scalar "front_sss_radius", color "back_sss_color", scalar "back_sss_weight", scalar "back_sss_radius", scalar "back_sss_depth" }, struct "s" { color "specular", scalar "exponent" }, struct "a" { scalar "lightmap_gamma", boolean "indirect", scalar "scale_conversion", scalar "scatter_bias", scalar "falloff", boolean "screen_composit" }, integer "mode", array light "lights")
分层对蒙皮进行模拟的结构如下所示:顶部反射光彩层(对于镜面反射度和表面非散射朗伯 (Lambertian) 漫反射)、双层次表面散射(模拟表层及其下层中的散射,此处统称为“皮下层”),以及从背面的“穿透”散射。
material "misss_fast_skin_phen" ( color texture "lightmap", color texture "depthmap", string "lightmap_group", scalar "lightmap_size", integer "samples", shader "bump", struct "d" { color "ambient", color "overall_color", color "diffuse_color", scalar "diffuse_weight", color "front_sss_color", scalar "front_sss_weight", scalar "front_sss_radius", color "mid_sss_color", scalar "mid_sss_weight", scalar "mid_sss_radius", color "back_sss_color", scalar "back_sss_weight", scalar "back_sss_radius", scalar "back_sss_depth" }, struct "s" { scalar "overall_weight", scalar "edge_factor", color "primary_spec_color", scalar "primary_weight", scalar "primary_edge_weight", scalar "primary_shinyness", color "secondary_spec_color", scalar "secondary_weight", scalar "secondary_edge_weight", scalar "secondary_shinyness", scalar "reflect_weight", scalar "reflect_edge_weight", scalar "reflect_shinyness", boolean "reflect_environment_only", shader "environment" }, struct "a" { scalar "lightmap_gamma", boolean "indirect", scalar "scale_conversion", scalar "scatter_bias", scalar "falloff", boolean "screen_composit" }, integer "mode", array light "lights")
参数 lightmap、 depthmap、 lightmap_group、 lightmap_size、 samples、 bump、 ambient、 lightmap_gamma、 indirect、 scale_conversion、 scatter_bias、 falloff 和 screen_composit 均与 misss_fast_simple_phen 中的对应项工作方式相同。
此现象与 misss_fast_skin_phen 完全相同,但支持置换贴图。该现象必须是单独的现象,因为带有置换的现象总是尝试置换对象。
material "misss_fast_skin_phen_d" (
color texture "lightmap",
color texture "depthmap",
string "lightmap_group",
scalar "lightmap_size",
integer "samples",
shader "displace",
shader "bump",
struct "d" {
...
}
integer "mode",
array light "lights")
所有其他参数均与 misss_fast_skin_phen 相同。
material "misss_mia_skin2_phen" ( color texture "lightmap", color texture "depthmap", string "lightmap_group", scalar "lightmap_size" default 50, integer "samples" default 64, shader "bump", struct "d" { color "ambient" default 0 0 0 0 , boolean "ao_on" default on, scalar "ao_distance" default 1.0, integer "ao_samples" default 16, color "diffuse_color" default .95 .95 1 , scalar "diffuse_roughness" default 0.3, scalar "diffuse_weight" default 0.5 , color "epi_sss_color" default 1 0.85 0.6 , scalar "epi_sss_weight" default 0.5 , vector "epi_sss_radius" default 20 10 5, color "epi_sss_radius_mod" default 1 1 1, color "front_sss_color" default 1 0.85 0.6 , scalar "front_sss_weight" default 0.5 , vector "front_sss_radius" default 20 10 5, color "front_sss_radius_mod" default 1 1 1, color "back_sss_color" default 0.7 0.1 0.1 , scalar "back_sss_weight" default 0.5, vector "back_sss_radius" default 20 10 5, color "back_sss_radius_mod" default 25, scalar "back_sss_depth" default 25, scalar "sampling_radius_mult" default 5 }, struct "r" { scalar "reflectivity" default 0.5, color "refl_color" default 0.75 0.9 1, scalar "brdf_90_degree_refl" default 1.0 , scalar "brdf_0_degree_refl" default 0.025 , scalar "refl_gloss" default 0.25, integer "refl_samples" default 16, scalar "refl_falloff_dist" default 0.0, scalar "hl_vs_refl_balance" default 1.0, boolean "refl_hl_only" default off, boolean "single_env_sample" default off, shader "environment", boolean "refl_interpolate" default off }, struct "s" { scalar "overall_weight" default 0.8, scalar "edge_factor" default 5.0, color "primary_spec_color" default 0.75 0.9 1, scalar "primary_weight" default 0.3, scalar "primary_edge_weight" default 0.8 , scalar "primary_shinyness" default 5.0 , color "secondary_spec_color" default 0.9 0.95 1.0 , scalar "secondary_weight" default 0.3, scalar "secondary_edge_weight" default 0.0, scalar "secondary_shinyness" default 33.0 }, struct "i" { integer "intr_grid_density" default 2, integer "intr_refl_samples" default 2 }, struct "a" { scalar "lightmap_gamma" default 0.75, boolean "indirect" default on, scalar "scale_conversion" default 1.0, scalar "scatter_bias" default 0.12, boolean "screen_composit" default off, color "additional_color" default 0 0 0 }, integer "mode", array light "lights")
使用以下参数:
此现象与 misss_mia_skin2_phen 完全相同,但支持置换贴图。该现象必须是单独的现象,因为带有置换的现象总是尝试置换对象。
material "misss_mia_skin2_phen_d" (
color texture "lightmap",
color texture "depthmap",
string "lightmap_group",
scalar "lightmap_size",
integer "samples",
shader "displace",
shader "bump",
struct "d" {
...
}
integer "mode",
array light "lights")
所有其他参数均与 misss_mia_skin2_phen 相同。
struct { vector "point", vector "normal" } "misss_lightmap_phen" ( color texture "lightmap", boolean "indirect" default off, scalar "lightmap_gamma" default 0.75, scalar "scatter_bias" default 0, color "ambient" default 0 0 0, integer "mode" default 4, #: property "lightmode" array light "lights" #: property "lightlink" )这是一个非常简单的现象,仅仅连接光照贴图着色器与默认的光照贴图采样着色器。在材质的光照贴图窗口中必须连接此现象。
"misss_mia_skin2_surface_phen" ( color texture "lightmap", integer "samples" default 64, vector "bump" default 0 0 0, color "ambient" default 0 0 0 0 , boolean "ao_on" default on, scalar "ao_distance" default 1.0, integer "ao_samples" default 16, color "diffuse_color" default .95 .95 1 , scalar "diffuse_roughness" default 0.3, scalar "diffuse_weight" default 0.5, color "epi_sss_color" default 1 0.85 0.6 , scalar "epi_sss_weight" default 0.5 , vector "epi_sss_radius" default 20 10 5, color "epi_sss_radius_mod" default 1 1 1, color "front_sss_color" default 1 0.85 0.6 , scalar "front_sss_weight" default 0.5 , vector "front_sss_radius" default 20 10 5, color "front_sss_radius_mod" default 1 1 1, color "back_sss_color" default 1 0.85 0.6 , scalar "back_sss_weight" default 0.5, vector "back_sss_radius" default 20 10 5, color "back_sss_radius_mod" default 1 1 1, scalar "back_sss_depth" default 0, scalar "sampling_radius_mult" default 5, scalar "reflectivity" default 0.5, color "refl_color" default 0.75 0.9 1, scalar "brdf_90_degree_refl" default 1.0 , scalar "brdf_0_degree_refl" default 0.025 , scalar "refl_gloss" default 0.25, integer "refl_samples" default 16, scalar "refl_falloff_dist" default 0.0, scalar "hl_vs_refl_balance" default 1.0, boolean "refl_hl_only" default off, boolean "single_env_sample" default off, shader "environment", boolean "refl_interpolate" default off, scalar "overall_weight" default 0.8, scalar "edge_factor" default 5.0, color "primary_spec_color" default 0.75 0.9 1, scalar "primary_weight" default 0.3, scalar "primary_edge_weight" default 0.8 , scalar "primary_shinyness" default 5.0, color "secondary_spec_color" default 0.9 0.95 1.0 , scalar "secondary_weight" default 0.3, scalar "secondary_edge_weight" default 0.0, scalar "secondary_shinyness" default 33.0, integer "intr_grid_density" default 2, integer "intr_refl_samples" default 2, scalar "lightmap_gamma" default 0.75, boolean "indirect" default on, scalar "scatter_bias" default 0.12, boolean "screen_composit" default off, color "additional_color" default 0 0 0, integer "mode" default 4, array light "lights" )此参数集与上述材质现象中的参数完全相同,唯一的区别在于未收集到结构中。有关详细信息,请参见 misss_mia_skin2_phen 文档。
Copyright © 1986, 2015 NVIDIA ARC GmbH. All rights reserved.