Version: 6000.3
语言: 中文
内置渲染管线中的表面着色器简介
内置渲染管线中的表面着色器和渲染路径

内置渲染管线中的表面着色器输出结构

表面标准输出结构着色器在 GPU 上运行的程序。更多信息
请参阅术语表
是这个:

struct SurfaceOutput
{
    fixed3 Albedo;  // diffuse color
    fixed3 Normal;  // tangent space normal, if written
    fixed3 Emission;
    half Specular;  // specular power in 0..1 range
    fixed Gloss;    // specular intensity
    fixed Alpha;    // alpha for transparencies
};

在 Unity 5 中,表面着色器内置渲染管线编写着色器的简化方法。更多信息
请参阅术语表
还可以使用基于物理的光照模型。内置标准和标准镜面反射光照模型(见下文)分别使用以下输出结构:

struct SurfaceOutputStandard
{
    fixed3 Albedo;      // base (diffuse or specular) color
    fixed3 Normal;      // tangent space normal, if written
    half3 Emission;
    half Metallic;      // 0=non-metal, 1=metal
    half Smoothness;    // 0=rough, 1=smooth
    half Occlusion;     // occlusion (default 1)
    fixed Alpha;        // alpha for transparencies
};
struct SurfaceOutputStandardSpecular
{
    fixed3 Albedo;      // diffuse color
    fixed3 Specular;    // specular color
    fixed3 Normal;      // tangent space normal, if written
    half3 Emission;
    half Smoothness;    // 0=rough, 1=smooth
    half Occlusion;     // occlusion (default 1)
    fixed Alpha;        // alpha for transparencies
};
内置渲染管线中的表面着色器简介
内置渲染管线中的表面着色器和渲染路径