Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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
1
Question by invulse · Sep 13, 2013 at 05:11 AM · shadersshadowslightscustom shader

Is it possible to create a light only casts shadows?

I'm currently in need of a way to make a light that only casts shadows and does not apply any light to the scene or any objects. I know its possible to have a light with a very low intensity cast a shadow but this does not work for my current needs. I'm not familiar enough with how shadows are done in engine to understand if this is possible with custom shadows, or custom code.

Comment
Add comment · Show 4
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 Benproductions1 · Sep 14, 2013 at 12:35 PM 0
Share

With the way it works that would be impossible. A shadow is simply not applying the light from that point light. If your point light has 0 intensity, technically everything is a shadow. What are you trying to do with this behaviour. I can't understand how that would even work???

avatar image syclamoth · Oct 11, 2013 at 07:43 AM 0
Share

Not exactly. Shadows, (like a lot of things in computer graphics) work the opposite way from how they do in real life- by default, everything is illu$$anonymous$$ated and you need to remove the lighting from specific areas if you wish to cast shadows. What you do with the shadow map when you have generated it is the interesting part here- where usually, yes- it is used to disable lighting on specific geometry, it could also be used to create negative light (to reduce the amount of light created by other lamps).

Unfortunately, I have no idea how to do this in Unity. It's kind of a complicated question.

avatar image Benproductions1 · Oct 11, 2013 at 07:54 AM 0
Share

@syclamoth Yes, that is how the light is applied, however that does not change the fact that you can't cast shadows without light. Negative light is an interesting idea (it might cause problems if HDR isn't enabled though, aka colour loss), but I believe the OP is looking for something more along the lines of a "Projector"

avatar image syclamoth · Oct 11, 2013 at 08:01 AM 0
Share

Negative lamps are super useful for making tricked-out lighting, and I really wish Unity supported them. In this case though, a projector would work assu$$anonymous$$g the shadows only need to be cast in a single direction.

5 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by Doireth · Oct 11, 2013 at 07:32 AM

Perhaps you should look into Projectors

Comment
Add comment · Share
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
0

Answer by kondrup · Oct 08, 2013 at 03:11 PM

Maybe this can help?

http://answers.unity3d.com/questions/269292/having-an-invisible-object-that-casts-shadows.html

Comment
Add comment · Show 4 · Share
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 Benproductions1 · Oct 11, 2013 at 07:03 AM 0
Share

That's not what the question was -1

avatar image meat5000 ♦ · Oct 14, 2013 at 08:51 PM 0
Share

Hmmmm, I don't know Ben. I think he may be on to something...

avatar image kondrup · Feb 24, 2015 at 06:16 PM 0
Share

why is the best answer in here downvoted? This does almost exactly what he is asking for.

avatar image andrewgotow kondrup · Jan 14, 2017 at 04:54 AM 0
Share

This is not what the original question is asking for.

The original question was for a "light that only casts shadows", essentially darkening regions of the scene which would be in-shadow for an "imaginary" light.

This suggestion creates an object which casts shadows, but is not otherwise visible. It would cast shadows for all of the existing, visible lights, but would not add shadows without a light in the scene.

avatar image
-2

Answer by PS3_and_PC_Geek · Oct 14, 2013 at 08:45 PM

usually, the objects themselves have a check box that have Cast shadows and receive shadows, The free edition of unity now has shadow support for Directional lights though

Comment
Add comment · Share
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
0

Answer by DHoffman · Oct 14, 2013 at 07:19 PM

I had a similar need, for which Projectors would not be the answer. I wanted to have a light that casts a shadow under the character - which moves of course, so the shadow would also have to move. The purpose is to make it so that you can easily see where the character is over the ground when they jump. Without it, it's hard to tell whether you're in the air or just further away from the camera.

My solution was to do this with one directional pointed straight down with a very low intensity to cast the shadows, and a second directional with no shadows and higher intensity that serves as the primary lighting. (Also some point or spot lights for localized effects, but that's unrelated.) To avoid the washed out effect, I subtracted the shadow-light's intensity from the original fill-light's intensity, and it looks almost the same as it did with just the fill-light and no shadows. Not ideal, but may be the best you can do without some really heavy shader coding.

Comment
Add comment · Share
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
0

Answer by ratamorph · Dec 20, 2013 at 12:20 AM

I'm also needing something like this. All my lighting is done using lightmaps and light probes, I just want a dynamic shadow for my character, but is it somehow possible to skip all the lighting computation on the shaders and just do the shadow projection? I think it would be much more efficient.

Comment
Add comment · Share
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

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

24 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

Related Questions

How can I add volume/depth to shadows? 0 Answers

Custom post processing override/shader disappears when opening up unity and doesn't show up in the build? 0 Answers

How would I occlusion cull lights? 1 Answer

shadow problem , Android 1 Answer

Optimize Shadows for Moving Light 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