- Home /
Shader that blends more than 2 textures
Hi,
I need to create a shader that allows you to blend more than 2 textures. I started with this below.`
http://wiki.unity3d.com/index.php/Blend_2_Textures.
I've attempted to try to modify it to incorporate more that 2 textures. I was able to add a third but unfortunetly it will only blend the tex01 and 02 but not the third. I'm a new to writing shaders. Not sure what I did wrong here.
Here's what I modified.
 Shader "Blend 3 Textures" { 
 Properties {
     
 _Blend01 ("Blend01", Range (0, 1) ) = 0.5 
 _Blend02 ("Blend02", Range (0, 1) ) = 0.5
 _MainTex ("Texture 1", 2D) = "" 
 _Texture2 ("Texture 2", 2D) = ""
 _Texture3 ("Texture 2", 2D) = ""
 
 }
 
 SubShader {    
 Pass {
         
 SetTexture[_MainTex]
 SetTexture[_Texture2]
          
 { 
             
 ConstantColor (0,0,0, [_Blend01]) 
 Combine texture Lerp(constant) previous
 }    
         
 SetTexture[_Texture2]
 SetTexture[_Texture3]
         
 {
 ConstantColor (0,0,0, [_Blend02]) 
 Combine texture Lerp(constant) previous
             
 }
 
     }
 } 
 }
 
Any help would be greatly apperciated.
Thanks!
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
How can I combine a color texture with a b&w texture and get color? 2 Answers
3 texture blend shader 2 Answers
2 texture blend shader 2 Answers
render Alpha only on another Alpha 0 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                