- Home /
Has anyone managed to make a decal shader with shadow support?
For a soccer game I want to add the chalk lines to the grass as a decal. Unity has a decal shader but it doesn't handle real-time shadows. I would rather keep the chalk and grass textures separate so would anyone have written a decal shader with real-time shadow support or has an idea how I could get shadows without combining textures? Btw, I can't use a transparent/cutoff shader as lines use alpha for fading/blur.
Answer by lowbloodsugar · Mar 17, 2010 at 06:44 AM
Render the chalk as different layer and composite them. If you don't want to render it as a different layer, I would recommend downloading the shader source code and tweaking the alpha blending formula. You can use the alpha blending to do much more then blend with transparency.
I made a whole bunch of shaders for doing decal type shading that account for lighting and underlying material using these techniques.
Your answer
Follow this Question
Related Questions
Shadow Support in Custom Shader 0 Answers
no shadow with until texture ?? 2 Answers
Make this shader receive and cast shadow? Can anyone help me thanks! 0 Answers
Simple shadows 1 Answer
Combine Basic Shadow Shader and Transparency Shader in Unity 0 Answers