- Home /
Question by
PixelSmash · Dec 20, 2014 at 01:16 AM ·
shadershadersshadowbake
Tinted multiply shader?
I'm currently writing a shader which will allow me to tint my textured object and overlay my baked shadowing (AO) over the top afterwards. This works as follows:
Shader "Unlit/AO Overlay"
{
Properties {
_Color1 ("Color", Color) = (1, 1, 1, 1)
_Texture1 ("Object Texture", 2D) = ""
_Texture2 ("Object Shadow", 2D) = ""
}
SubShader {
Pass {
SetTexture[_Texture1]
{
constantColor [_Color1]
combine texture * constant
}
SetTexture[_Texture2]
{
Combine texture * previous
}
}
}
}
The problem is that I also want to be able to adjust the strength of the shadowing using a float, after scouring the internet I'm still not entirely sure about how I might do that. I can use:
texture Lerp(constant) previous
But that's not quite what I want because - as it's shadowing - I want it to multiply.
Any suggestions would be much appreciated!
Comment
Your answer
Follow this Question
Related Questions
Having problems with unlit shaders casting shadows 0 Answers
bake error 1 Answer
Shadows with Alpha, fade out shadow. 2 Answers
Is it possible to change the shadow that is cast? 1 Answer
I need swaying, self-shadowing, ultra-realistic grass 0 Answers