Rendering Mode 渲染模式 Shader系列5

Rendering Mode 渲染模式

本文档主要是对Unity官方手册的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
文章中涉及到的操作都是基于Unity2018.1版本
参考链接:https://docs.unity3d.com/Manual/StandardShaderMaterialParameterRenderingMode.html

在这里插入图片描述
A Standard Shader material with default parameters and no values or textures assigned. The Rendering Mode parameter is highlighted.
突出显示渲染模式参数。

The first Material Parameter in the Standard Shader is Rendering Mode. This allows you to choose whether the object uses transparency, and if so, which type of blending mode to use.
标准着色器中的第一个材质参数是渲染模式。这允许您选择对象是否使用透明度,如果是,使用哪种类型的混合模式。

  • Opaque - Is the default, and suitable for normal solid objects with no transparent areas.
    不透明-是默认值,适用于没有透明区域的普通实体对象。
  • Cutout - Allows you to create a transparent effect that has hard edges between the opaque and transparent areas. In this mode, there are no semi-transparent areas, the texture is either 100% opaque, or invisible. This is useful when using transparency to create the shape of materials such as leaves, or cloth with holes and tatters.
    裁切-允许你创建一个透明的效果,在不透明和透明区域之间有硬边。在这种模式下,没有半透明区域,纹理要么100%不透明,要么不可见。当使用透明度来创建材料的形状,如叶子,或有洞和支离破碎的形状时,这是很有用的。
  • Transparent - Suitable for rendering realistic transparent materials such as clear plastic or glass. In this mode, the material itself will take on transparency values (based on the texture’s alpha channel and the alpha of the tint colour), however reflections and lighting highlights will remain visible at full clarity as is the case with real transparent materials.
    透明-适用于渲染真实的透明材料,如透明塑料或玻璃。在这种模式下,材质本身将渲染透明度值(基于纹理的alpha通道和颜色的alpha值),然而反射和灯光高光在完全透明的情况下仍然是可见的,就像真实的透明材质一样。
  • Fade - Allows the transparency values to entirely fade an object out, including any specular highlights or reflections it may have. This mode is useful if you want to animate an object fading in or out. It is not suitable for rendering realistic transparent materials such as clear plastic or glass because the reflections and highlights will also be faded out.
    淡出-允许一个对象依据透明度值完全淡出,包括它可能有的高光或反射。如果你想让一个物体淡出或淡出动画效果,这个模式是很有用的。它不适合渲染真实的透明材料,如透明的塑料或玻璃,因为反射和高光也会淡出。
    在这里插入图片描述
    The helmet visor in this image is rendered using the Transparent mode, because it is supposed to represent a real physical object that has transparent properties. Here the visor is reflecting the skybox in the scene.
    在这幅图像中的头盔面罩是使用透明模式渲染的,因为它应该代表一个真实的物理对象,具有透明的属性。这里护目镜反射了场景中的天空盒。

    在这里插入图片描述
    These windows use Transparent mode, but have some fully opaque areas defined in the texture (the window frames). The Specular reflection from the light sources reflects off the transparent areas and the opaque areas.
    这些窗口使用透明模式,但在纹理(窗框)中定义了一些完全不透明的区域。来自光源的高光反射反射出透明区域和不透明区域。

    在这里插入图片描述
    The hologram in this image is rendered using the Fade mode, because it is supposed to represent an opaque object that is partially faded out.
    此图像中的全息图使用淡出模式渲染,因为它应该表示部分淡出的不透明对象。

    在这里插入图片描述
    The grass in this image is rendered using the Cutout mode. This gives clear sharp edges to objects which is defined by specifying a cut-off threshold. All parts of the image with the alpha value above this threshold are 100% opaque, and all parts below the threshold are invisible. To the right in the image you can see the material settings and the alpha channel of the texture used. 这张图片中的草是使用裁切模式渲染的。这为通过指定裁切阀值定义的对象提供了清晰的锐利边缘。alpha值高于此阈值的图像的所有部分都是100%不透明的,低于阈值的所有部分都是不可见的。在图像的右边,你可以看到材质设置和纹理的alpha通道。