Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Coguelin · Apr 15, 2016 at 12:34 PM · lightingshadersshadowscolourextensions

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.

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tanoshimi · Apr 15, 2016 at 01:26 PM 0
Share

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?

avatar image Coguelin · Apr 15, 2016 at 05:52 PM 0
Share

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.

avatar image bonniemathew · Jul 14, 2016 at 09:19 AM 0
Share

@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...

avatar image Daniel__Vernon · Sep 27, 2017 at 08:47 AM 0
Share

@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

avatar image LeonmanRolls · Aug 28, 2020 at 03:50 AM 0
Share

I would also love to know how to achieve this

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

50 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges