Страница 1 из 1

Подборка универсальных шейдеров для ифона

СообщениеДобавлено: 07 ноя 2010, 08:10
gnoblin
Нагуглил подборку универсальных шейдеров в помощь разработчику для ифона (popcorn1)

Синтаксис:
Используется glsl
Shader "Unlit/Unlit" {
   
Properties {_MainTex ("Texture", 2D) = ""}

SubShader {Pass {SetTexture[_MainTex]} }

}


Синтаксис:
Используется glsl
Shader "Unlit/UnlitColored" {
    Properties {
        _Color ("Main Color", Color) = (1,1,1,1)
        _MainTex ("Base (RGB)", 2D) = "white" {}
    }
    Category {
       Lighting Off
       ZWrite On
       Cull Back
       SubShader {
            Pass {
               SetTexture [_MainTex] {
                    constantColor [_Color]
                    Combine texture * constant, texture * constant
                 }
            }
        }
    }
}


Синтаксис:
Используется glsl
Shader "Unlit/UnlitForward" {
    Properties {
        _Color ("Main Color", Color) = (1,1,1,1)
        _MainTex ("Base (RGB)", 2D) = "white" {}
    }
    Category {
       Lighting Off
       ZWrite On
       Cull Back
       Offset -1, -1
       SubShader {
            Pass {
               SetTexture [_MainTex] {
                    constantColor [_Color]
                    Combine texture * constant, texture * constant
                 }
            }
        }
    }
}


Синтаксис:
Используется glsl
Shader "Unlit/AlphaSelfIllum" {
    Properties {
        _Color ("Color Tint", Color) = (1,1,1,1)
        _MainTex ("SelfIllum Color (RGB) Alpha (A)", 2D) = "white"
    }
    Category {
       Lighting On
       ZWrite Off
       Cull Back
       Offset -1, -1
       Blend SrcAlpha OneMinusSrcAlpha
       Tags { "Queue" = "transparent" }
       SubShader {
            Material {
               Emission [_Color]
            }
            Pass {
               SetTexture [_MainTex] {
                      Combine Texture * Primary, Texture * Primary
                }
            }
        }
    }
}


Синтаксис:
Используется glsl
Shader "Unlit/AlphaSelfIllumDoubleSided" {
    Properties {
        _Color ("Color Tint", Color) = (1,1,1,1)
        _MainTex ("SelfIllum Color (RGB) Alpha (A)", 2D) = "white"
    }
    Category {
       Lighting On
       ZWrite Off
       Cull Off
       Blend SrcAlpha OneMinusSrcAlpha
       Tags { "Queue" = "transparent" }
       SubShader {
            Material {
               Emission [_Color]
            }
            Pass {
               SetTexture [_MainTex] {
                      Combine Texture * Primary, Texture * Primary
                }
            }
        }
    }
}


Синтаксис:
Используется glsl
Shader "Unlit/AlphaSelfIllumWithFade"
{
    Properties
    {
        _Color ("Color Tint", Color) = (1,1,1,1)    
        _MainTex ("Base (RGB) Alpha (A)", 2D) = "white"
    }

    Category
    {
        Lighting Off
        ZWrite Off
        //ZWrite On  // uncomment if you have problems like the sprite disappear in some rotations.
        Cull back
        Blend SrcAlpha OneMinusSrcAlpha
        //AlphaTest Greater 0.001  // uncomment if you have problems like the sprites or 3d text have white quads instead of alpha pixels.
        Tags {Queue=Transparent}

        SubShader
        {
            Pass
            {
                SetTexture [_MainTex]
                {
                        ConstantColor [_Color]
                        Combine Texture * constant
                }
            }
        }
    }
}