- Home /
render Alpha only on another Alpha
I need to get a texture to only render/show on the alpha cutout part of another texture on an object.
Explain using an example:
I have this 2D car right and then some blood objects instantiate on top of it. What I need is for that instantiated blood to only show on alpha channel/cutout part of the car.
Hope you understand.
This would be easiest/cheapest if it was combined in the same shader so you could sample both textures at the same time. Otherwise you'd need a Grab pass. Is that what you are after?
Are there any shaders that do that already?
Its very hard for me to find info on this. I am busy checking grab pass now.
Not that I know of but it would be reasonably easy to write as a surface shader. Grab passes might cause you issues because they use everything that came before. Sounds like a job for a custom shader to me. They aren't so hard to write - did a short course over on http://unitygems.com
Wait wait this might cause me another problem. Because theres blood on the floor and when the alpha on the texture of the car passes over it will hide it won't it?
... and yes grab pass looks nasty lol.
It depends what's rendering the blood on the floor. If it's another object then no - it will already be rendered and the car alpha won't do much about it.
Your answer
Follow this Question
Related Questions
Add transparency to this shader? 0 Answers
Blend two texture diffuse shader with alpha 0 Answers
Decal Alpha Blend 0 Answers