- Home /
unlit transparent shader: How to add alpha composition combined with the texture alpha
Hi,
Ok, I have an unlit transparent shader that works very well, but I need to compose it with the rest of the scene and control it's transparency.
So really I am looking into having a alpha value exposed in the material settings that I is composed with the texture alpha channel so that I can make it completly transparent.
How would I do that shader gurus :)
Thanks for your help,
Jean
It would likely involve multiplication. Post your code and I'll modify it for you.
Answer by Jessy · Feb 21, 2011 at 07:50 PM
It's been a few hours. If this isn't good, post what you had, and I'll combine the two.
Shader "I Assume You Named It Already" {
Properties { _Opacity ("Opacity Mod", Range(0,1)) = 1 _MainTex ("Texture (A = Opacity)", 2D) = "" }
SubShader { Tags {Queue = Transparent} ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Pass { ConstantColor(0,0,0, [_Opacity]) SetTexture[_MainTex] {Combine texture, texture * constant} } }
}
Your answer
Follow this Question
Related Questions
2D dark shader makes my texture transparent? 0 Answers
Transparent Diffuse Specular Normal Shader problem 1 Answer
Is there a way to have a transparent vertex shader recieve and cast Shadows? 0 Answers
transparent object: everything behind it appears in grayscale 0 Answers
How to create a caustic effect due to water surface 2 Answers