- Home /
Is it possible to change the shadow that is cast?
Its all in the question. Specifically, I need to find a way to have dynamic shadows, but the shadows are no longer realistic. More specifically, I would prefer a way to replace the way the shadow looks with a texture that moves dynamically in place of the shadow.
Yes, I am willing to code shaders and yes, I have dabbled in it a little already. I will continue my research in shaders; however, if it cannot be done within unity I need to know if I am wasting my time.
Mainly, I just need to know if it can be done. I don't need specific instruction on how to do it (yet at least). If it can, am I correct in coding shaders? if not, where would I begin?
I don't want to go into too much detail about why I need it, and I appreciate your understanding and help in advance.
Answer by tanoshimi · Oct 27, 2013 at 06:52 AM
Yes, shadows are controlled by specific passes in your shader, with the tags "LightMode" = "ShadowCollector" and "LightMode" = "ShadowCaster". You can customise these however you want to specify how an object receives and casts shadows respectively.
Ty for the reply, and I will leave this up for anyone with the same question. However, after about 11 hours of preli$$anonymous$$ary research about the engine, converting my UD$$anonymous$$ knowledge to Unity, and learning shader coding, I found out that all I have to work with in Unity is projectors. Back to the UD$$anonymous$$.
You'll have to schedule a lot more than 11hrs to learn shader coding! And why are you now talking about projectors? Although they can be used to simulate simple blob shadows, they're not the same. Anyway - I did give you the answer to your question - it would be gracious of you to mark it as such :)
I meant that all I have to work with in full Indie Unity is projectors in terms of shadows, or at least that's what I've been led to believe since I read that shadows are a pro only feature. Of course, I was fully prepared to do the work, but that doesn't change that I spent a considerable amount of time on an engine that wont help me, because for the full effect to be achieved I require dynamic shadows for the main character and a blob shadow wont cut it. Also as you've probably noticed, I am new here and had no clue that I needed to mark it as answered. I have done so.
Since Unity 4.2 you've been able to use "hard" shadows from a directional light in Unity Free. However, if you want soft shadows, or multiple shadows from different light sources you'll need Unity Pro.
Your answer
Follow this Question
Related Questions
Toon shader light culling shadow issue 0 Answers
Shadows have weird seams and gaps 1 Answer
Any way to get rid of squares (artifacts) in a semi transparent shadow of a fade shader? 0 Answers
Shadows with Alpha, fade out shadow. 2 Answers
I need swaying, self-shadowing, ultra-realistic grass 0 Answers