- Home /
Shader to object reference
Hi, is there a possibility to let a shader script access some object information to which it is attached, like layer id? For example I want to let the shader add only background colors from particular objects and not from all of them. My idea is to have some objects with transparent surface which should simulate shadow on the ground, but they should add color only from the background and not from other "shadow object", because i want to use many of them to have more dynamic shadow behavior.
Answer by DaveA · Mar 01, 2012 at 12:45 AM
I would think, worst case, you could have a param on your shader which you could set via, say, Start function. Set it on the renderer's material (your shader)
Your answer
Follow this Question
Related Questions
Fading shadows in / out along with material. 0 Answers
Shading Eyes in a Shadow 0 Answers
Stylish shadow / Patterned shadow 1 Answer
GameObject not receiving shadows 0 Answers
Optimise adding shadows in scene using Unity iPhone 2 Answers