Рубрики
Surface Standard

SurfaceOutputStandard

  • выходная структура поверхностного шейдера
    встроенный код HLSL

[post10644 surface]

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
};
Рубрики
Custom Surface

«Объект красного цвета»

[post10644 surfaceshader]

#pragma surface surf Standard
Shader "Custom/SH_surf"
{
    SubShader
    {
        CGPROGRAM
        #pragma surface surf Standard
        sampler2D _MainTex;

        struct Input
        {
            float3 color : RED;
        };
        void surf (Input IN, inout SurfaceOutputStandard o)
        {
            o.Albedo = IN.color;
            o.Alpha = 1;
        }
        ENDCG
    }
}