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

Шейдерлаб (fixed function pipeline) и cg\glsl шейдеры для OpenGL ES 2.0 для мобилок

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

Сообщение gnoblin 07 ноя 2010, 08:10

Нагуглил подборку универсальных шейдеров в помощь разработчику для ифона (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
                }
            }
        }
    }
}
skypeid: madkust
Мои крайние проекты:
Убойный Хоккей
Cube Day Z (альфа)
Аватара пользователя
gnoblin
Адепт
 
Сообщения: 4633
Зарегистрирован: 08 окт 2008, 17:23
Откуда: Минск, Беларусь
Skype: madkust
  • Сайт

Вернуться в Mobile shaders

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 4