- Home /
Question by
wiiarethesound · Jun 07, 2013 at 05:02 PM ·
shadertransparentcutoutunlit
Unlit Transparent Cutout shader that can switch between two textures
Hi all,
I've been doing a bit of research into shaders (which I am brand new to, btw), as I would like a shader that is essentially the same as Unity's built in Unlit Transparent Cutout shader, but will render one of two textures based on a property that I can set through code. Here is what I have so far (which is basically all taken from the built in shader):
Shader "Example/Unlit Transparent Cutout Test" {
Properties {
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_SecondTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_TexValue ("Texture Value", Range(0,1)) = 0.0
}
SubShader {
Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
LOD 100
Pass {
Lighting Off
Alphatest Greater [_Cutoff]
SetTexture [_MainTex] { combine texture }
}
}
}
I'm guessing that I have to change something in the SetTexture part, but I'm not sure what. Any help would be much appreciated. Thanks!
Comment
Your answer
Follow this Question
Related Questions
Transparent Cutout Shader? 1 Answer
Unlit alpha shader makes my object transparent? 0 Answers
Add alpha cutout and lighting to custom unlit shader 0 Answers
Transparent shaders render as fullbright 0 Answers
Crash: cutout shaders on mobile 1 Answer