• Real-Time Rendering——9.13 Blending and Filtering Materials混合和过滤材料


    Material blending is the process of combining the properties, i.e., the BRDF parameters, of multiple materials. For example, to model a sheet of metal with rust spots,we could paint a mask texture to control the rust spot locations and use it to blend between the material properties (specular color F0, diffuse color ρss, and roughness α) of rust and metal. Each of the materials being blended can also be spatially varying,with parameters stored in textures. Blending can be done as a preprocess to create a new texture, often referred to as “baking,” or on the fly in the shader. Although the surface normal n is technically not a BRDF parameter, its spatial variation is important for appearance, so material blending typically includes normal map blending as well.

    材料混合是组合多种材料的特性,即BRDF参数的过程。例如,要为带有锈斑的金属板建模,我们可以绘制一个遮罩纹理来控制锈斑的位置,并使用它来混合铁锈和金属的材质属性(高光颜色F0、漫反射颜色ρss和粗糙度α)。混合的每种材质也可以在空间上变化,参数存储在纹理中。混合可以作为创建新纹理的预处理,通常称为“烘焙”,或者在着色器中动态进行。虽然表面法线n在技术上不是BRDF参数,但它的空间变化对外观很重要,因此材质混合通常也包括法线贴图混合。

    Material blending is critical to many real-time rendering applications. For example, the game The Order: 1886 has a complex material blending system [1266, 1267, 1410] that allows users to author arbitrarily deep stacks of materials drawn from an extensive library and controlled by various spatial masks. Most of the material blending is done as an offline preprocess, but certain compositing operations can be deferred to runtime as needed. This runtime processing is typically used for environments, to add unique variations to tiled textures. The popular material authoring tools Substance Painter and Substance Designer use a similar approach for material compositing, as does the Mari texture painting tool.

    材质混合对于许多实时渲染应用程序来说至关重要。例如,游戏《秩序:1886》有一个复杂的材料混合系统[1266,1267,1410],它允许用户创作任意深度的材料,这些材料来自一个庞大的库,并由各种空间遮罩控制。大多数材质混合是作为离线预处理完成的,但是某些合成操作可以根据需要推迟到运行时进行。这种运行时处理通常用于环境,为平铺纹理添加独特的变化。流行的材质创作工具Substance Painter和Substance Designer使用类似的方法进行材质合成,Mari纹理绘制工具也是如此。

    Blending texture elements on the fly provides a diverse set of effects while conserving memory. Games employ material blending for various purposes, such as:

    动态混合纹理元素可提供多种多样的效果,同时节省内存。游戏出于各种目的使用材料混合,例如:

    • Displaying dynamic damage on buildings, vehicles, and living (or undead) creatures [201, 603, 1488, 1778, 1822].
    • Enabling user customization of in-game equipment and clothing [604, 1748].
    • Increasing visual variety in characters [603, 1488] and environments [39, 656, 1038]. See Figure 20.5 on page 891 for an example.

    显示建筑物、车辆和生物(或不死生物)的动态伤害[201,603,1488,1778,1822]。

    支持用户定制游戏中的装备和服装[604,1748]。

    增加人物[603,1488]和环境[39,656,1038]的视觉多样性。参见891页图20.5中的示例。

    Sometimes one material is blended on top of another with less than 100% opacity, but even fully opaque blends will have pixels (or texels, if baking into textures) on mask boundaries where a partial blend needs to be performed. In either case, the strictly correct approach would be to evaluate the shading model for each material and blend the results. However, blending the BRDF parameters and then evaluating the shading once is much faster. In the case of material properties that have a linear or nearly linear relationship to the final shaded color, such as the diffuse and specular color parameters, little or no error is introduced by such interpolation. In many cases,even for parameters with a highly nonlinear relationship to the final shaded color (such as specular roughness), the errors introduced along mask boundaries are not objectionable. 

    有时,一种材质以小于100%的不透明度混合在另一种材质之上,但即使是完全不透明的混合,在需要执行部分混合的蒙版边界上也会有像素(或纹理元素,如果烘焙到纹理中)。在这两种情况下,严格正确的方法是评估每种材质的着色模型并混合结果。然而,混合BRDF参数,然后评估着色一次要快得多。对于与最终着色颜色具有线性或近似线性关系的材质属性,如漫反射和镜面反射颜色参数,这种插值很少或没有引入误差。在许多情况下,即使对于与最终着色颜色具有高度非线性关系的参数(例如镜面粗糙度),沿着掩模边界引入的误差也不是令人讨厌的。

    Blending normal maps requires special consideration. Often good results can be achieved by treating the process as a blend between height maps from which the normal maps are derived [1086, 1087]. In some cases, such as when overlaying a detail normal map on top of a base surface, other forms of blending are preferable [106].

    混合法线贴图需要特别考虑。通常,通过将该过程视为高度图之间的混合,可以获得良好的结果,法线图从高度图中导出[1086,1087]。在某些情况下,例如当在基础表面上覆盖一个细节法线贴图时,其他形式的混合是优选的[106]。

    Material filtering is a topic closely related to material blending. Material properties are typically stored in textures, which are filtered via mechanisms such as GPU bilinear filtering and mipmapping. However, these mechanisms are based on the assumption that the quantity being filtered (which is an input to the shading equation) has a linear relationship to the final color (the output of the shading equation). Linearity again holds for some quantities, but not in general. Artifacts can result from using linear mipmapping methods on normal maps, or on textures containing nonlinear BRDF parameters, such as roughness. These artifacts can manifest as specular aliasing (flickering highlights), or as unexpected changes in surface gloss or brightness with a change in the surface’s distance from the camera. Of these two, specular aliasing is much more noticeable; techniques for mitigating these artifacts are often referred to as specular antialiasing techniques. We will now discuss several of these methods.

    材料过滤是一个与材料混合密切相关的话题。材质属性通常存储在纹理中,纹理通过GPU双线性过滤和mipmapping等机制进行过滤。然而,这些机制基于这样的假设,即被过滤的量(它是着色方程的输入)与最终颜色(着色方程的输出)具有线性关系。线性同样适用于某些量,但并不普遍适用。在法线贴图或包含非线性BRDF参数(如粗糙度)的纹理上使用线性小中见大贴图方法可能会产生伪像。这些伪像可以表现为镜面混叠(闪烁高光),或者随着表面与相机的距离的变化,表面光泽或亮度发生意外变化。在这两者中,镜面锯齿更加明显;减轻这些伪像的技术通常被称为镜面抗锯齿技术。我们现在将讨论其中的几种方法。

  • 相关阅读:
    10.26~10.27论文,ALP: AdaptiveLossless floating-Point Compression
    AX=0和AX=b的解向量线性相关吗?
    Android学习笔记 1.2.5 Gradle插件和java、application等插件 && 1.2.6 依赖管理
    PMP模拟题 | 每日一练,快速提分
    一图读懂融云出海 & 全球化通信方案
    Java 后端 本地调试-获取微信公众号 openId
    操作系统学习笔记
    html实训大作业《简单的学生网页作业源码 基于html css javascript红色文化传媒网站(20页)》
    Linux中使用nvidia-smi命令实时查看指定GPU使用情况
    (GCC)STM32基础详解之全局资源的使用
  • 原文地址:https://blog.csdn.net/m0_37609239/article/details/126221850