欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

双面渲染

程序员文章站 2022-06-10 21:14:01
...

Shader "Custom/DoubleShader" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)//Tint Color
_MainTex ("Base (RGB)", 2D) = "white" {}
_MainTex_2 ("Base (RGB)", 2D) = "white" {}
}

SubShader {
Tags { "RenderType"="Opaque" }
LOD 100

Pass {  
    Cull Front  
    Lighting Off  
    SetTexture [_MainTex] { combine texture }   
    SetTexture [_MainTex]  
    {  
        ConstantColor [_Color]  
        Combine Previous * Constant  
    }  
}  

Pass  
{  
    Cull Back  
    Lighting Off  
    SetTexture [_MainTex_2] { combine texture }   
    SetTexture [_MainTex_2]  
    {  
        ConstantColor [_Color]  
        Combine Previous * Constant  
    }  
}  

}
}