- Home /
Extending the Light Class to select Shadow Colour
Hey folks, long time no see.
I'm trying to set up a system to let us select the colour of shadows cast by a light.
I know how to create a shader to let them select the colour of shadows received by an object but I have no idea how I would go about doing that from the light source.
I figure it might be possible to set up a script that grabs the shadow map and tints shadows based on the colour set by the artist but... ugh, that sounds messy.
So I was wondering : do any of you have an idea how it could be done from the light object? Or will I just have to make them set the received shadow colour per object?
I'd appreciate any kind of insight, thanks for your help!
All the best, R.
The colour of a shadow is not deter$$anonymous$$ed by a light since, by definition, the shadow is the bit that this light doesn't fall on... it's a property of an object on which the shadow is cast, or perhaps something you could set globally to affect the way the shadow map is applied, but I don't think it's going to be straightforward to do. What effect exactly are you trying to achieve?
Hi @tanoshimi, thanks for your reply!
Yep, that's what I expected.
I built my artists a shader to colour the shadow received, but they requested a "Shadow Colour" variable they could set in the light rather than the object.
I agree regarding the shadow map, it wouldn't be all that simple to implement.
@Coguelin... Did you figure out how to do it? I also have a similar requirement. To extend the Light class provided by Unity and add some additional features...
@bonniemathew Did you end up learning how to extend the light class? I could definitely benefit from this and would appreciate anything you've found
Your answer
Follow this Question
Related Questions
Shadow sprite rotation regardless of the light source 0 Answers
Foliage shader advice/Soft Edge Unlit shader help 0 Answers
How can I enable 'normal' shadows on a dithered -> transparent object? 0 Answers
Toon shader light culling shadow issue 0 Answers
How can I add volume/depth to shadows? 0 Answers