Показать сообщение отдельно
Старый 22.02.2013, 11:53   #911
pax
Unity/C# кодер
 
Аватар для pax
 
Регистрация: 03.10.2005
Адрес: Россия, Рязань
Сообщений: 7,568
Написано 3,006 полезных сообщений
(для 5,323 пользователей)
Ответ: Фак по Юнити.

Там вероятно я недописал во второй SetTexture
SetTexture [_MainTex] {combine texture * previous, previous} 
т.е. вероятно правильно вот так
Shader "MaskedTexture"
{
   
Properties
   
{
      
_Color ("Main Color", Color) = (1,1,1,1)
      
_MainTex ("Base (RGB)", 2D) = "white" {}
      
_Mask ("Culling Mask", 2D) = "white" {}
      
_Cutoff ("Alpha cutoff", Range (0,1)) = 0.1
   
}
   
SubShader
   
{
      
Tags {"Queue"="Transparent"}
      
Lighting Off
      ZWrite Off
      Blend SrcAlpha OneMinusSrcAlpha
      AlphaTest GEqual 
[_Cutoff]
      
Pass
      
{
         
SetTexture [_Mask] 
         {
             
constantColor [_Color]
             
combine texture * constant DOUBLE
         
}
         
SetTexture [_MainTex] {combine texture * previous, previous}
      }
   }
} 
__________________
Blitz3d to Unity Wiki
(Offline)
 
Ответить с цитированием