• 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 /
This question was closed Nov 16, 2015 at 03:33 AM by Le-Pampelmuse for the following reason:

The question is answered, right answer was accepted.

avatar image
3
Question by Le-Pampelmuse · Feb 26, 2015 at 09:49 PM · lightingspotlightrealtime-shadows

Still in UNITY 5 - Unbelievable: Spotlight Shadow cut off at "close" distance.

Edited: I downloaded Unity 5, and tested it there. Still the same embarrasing and immersion-killing bug. The following text is the original question#

Edit No 2: Updated to Unity 5.1! No fix or recognition of that bug anywhere. I got no response from my bug report. What went wrong in Unity?#

Edit No 3: I finally reached someone from Unity by reporting a completely unrelated bug in another ticket and asking them wtf is up with my report. It has been handed to the Developers now and will be fixed in the future. FINALLY. After 6 Years they started to LOOK into it.

Unity 5.1.2p3: still not fixed

Hi, this is my 3rd question here, I only post questions I can't find an answer to on Google.

The only entry relevant is another post on this forum but it is over one year old now and has no comments.

Here's my Problem:

For any Spotlight that is closer than some value, which seems to be corelating with the range, to an object, the object's shadow starts to get clipped/cut off.

For example:

I have a spotlight parented to my camera, no cookie, no script attached, nothing fancy attached. It is a plain spot light.

Spotlight has range 10. When moving it close to an obstacle, at some point the shadow of the obstacle starts clipping into the surface it is projected on. When moving even closer to the obstacle, the clipping continues until the shadow can't be seen anymore.

When increasing the range of said light, the clipping occurs earlier. I made a video to demonstrate it:

https://www.youtube.com/watch?v=fri2uwWIgtw

This video might be more useful to spot the bug:

https://www.youtube.com/watch?v=DdIKnxrc2AI

Please answer if you know what causes this problem. Thank you.

Comment
Add comment · Show 6
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 Le-Pampelmuse · Mar 04, 2015 at 04:43 AM 1
Share

I found some posts from 2010 on Google, where people had a similar problem with spotlights only. There was no solution either. It seems that nobody cares about that problem.

This problem is more than 5 years old now!

It is a very annoying visual bug that makes using non-static spotlights impossible. Like flashlights, car headlights, etc.

avatar image Le-Pampelmuse · Mar 08, 2015 at 04:06 AM 1
Share

Please note that this happens to spotlights only! Pointlights cast shadows until the "sink into" the obstacle.

If anyone has the slightest clue, please tell me!

avatar image pedja · Mar 13, 2015 at 12:25 PM 1
Share

It would really help if you could share your scene file with others, ins$$anonymous$$d of video.

avatar image Le-Pampelmuse · Mar 18, 2015 at 10:56 AM 1
Share

pedja, the scene file would be useless since you could not open it.

I made another project in Unity 5 and uploaded it so you can look at it:

https://www.dropbox.com/sh/codk32octf45rz9/AADWBwmgZxEadfDrs-xklegNa?dl=0

You have to know something how to fix this, otherwise you would't have asked for the scene file, so please tell me what's wrong with my settings.

Thanks

avatar image Le-Pampelmuse · Apr 01, 2015 at 11:03 AM 1
Share

So, pedja. 2 Weeks have passed, how did it help you looking at a project of $$anonymous$$e?

If you have any information about this, which I'm sure you do, because why else would you have asked for the scene file, please share it with me, and the internet.

Show more comments

4 Replies

  • Sort: 
avatar image
2
Best Answer

Answer by Le-Pampelmuse · Oct 28, 2015 at 09:13 AM

Everybody, I'm sick of it now. Since that Unity employee told me, they would update the spotlight inspector to show the near clip value but it will NEVER be below 0.02f I am officially banning spotlights from everything I do in Unity.

Thank you Datapax for your input!

Comment
Add comment · Show 2 · 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 SumFortyOne · Nov 15, 2015 at 08:21 AM 1
Share

That's one of reasons why I joined Unity Answer because this is a big problem and I cant find on Internet anything. :(

avatar image Le-Pampelmuse SumFortyOne · Nov 15, 2015 at 09:19 PM 1
Share

It's a joke if you ask me. A very bad joke.

avatar image
3

Answer by LSPressWorks · Apr 01, 2015 at 01:13 PM

try seeing if the shadow distance and cascade settings in quality helps. From what the video shows though, it looks like the near proximity is causing the Light objects cone to penetrate the object. Thus, from the perspective of the Engine, the light is shining from beside or behind those shelves.

Relax. People lose interest in helping if you're combative.

Comment
Add comment · Show 2 · 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 Le-Pampelmuse · Apr 04, 2015 at 08:54 PM 1
Share

I cannot shrink the shadow distance anymore. I got it down to 50, which is my limit because that is the longest my player can "see" inside my level. I have tried all quality settings and lighting methods (deferred, deferred legacy, cascades, shadow resolution, etc...even linear or gamma color space which has nothing to do with it).

Can you answer me the following: Do you have that bug too? Can you try it please?

I have to know if Unity has terrible lighting on purpose, or if it has something to do with my setup..

Please can you try it?

Take any scene with a wall, a cube (1x1x1) and a spotlight (range 20) and move the light closer to the cube.

Thank you!

avatar image Le-Pampelmuse · Apr 13, 2015 at 02:51 PM 1
Share

LSPressWorks, can you please tell me if you have this problem too? All the answers are fine and I am grateful for them, but no one has yet answered me the question if they have that problem too, or had it but solved it.

avatar image
1

Answer by Datapax · Sep 16, 2015 at 03:34 PM

My friend, I am facing the same nightmare as you and I also think this is ridiculous and the dev's really have to get rid of this ASAP - it is just so annoying and painful for the eye and for my brain being unable to fix it.

However, I came up with a "FIX" for this problem and I would like to share it with you and others that can end up on this thread with this problem. So here is a little step by step for everyone, until they fix this bug from our worst nightmares ;D

  1. Get a 3D modelling program, 3D MAX / Maya / Blender ... whatever you like and want.

  2. Create a cylinder and make it hollow, so it represents the mesh of a real flashlight. I put a small box inside of the flashlight so I can use it later for a reference to attach the light. Finally - export and import to Unity.

  3. Attach, scale and position your flash light as you like.

  4. In the inspector be sure that you configure your cylinder "Mesh renderer" to cast "Shadows Only" and disable receive shadows. (this will hide the object and only leave us with the light effects, if you like it otherwise please feel free to configure as you like).

  5. Attach a "Point Light" object to your "box" reference that you created earlier.

  6. Set up the light as you like (range, color, intensity, shadow types and etc.)

  7. Don't turn off your original "Spotlight". Instead just set the Shadow Type to "No Shadows" but leave the rest as you had it before. This way you still use the cookie texture and light settings if you had one before. It is your choice if you want to turn it off or change the settings in another way, but I recommend to keep it so it looks pretty much as intended.

This should be enough to have a nice looking flashlight with proper shadow mapping and no more "cutoff". You can adjust your settings even more if you want to reach a better effect and set your lights properly for your scenes. Be sure to review all the settings and polish everything to improve this effect. I hope this helps till we get some solution from the dev's.

Best regards and good luck to all. :)

Comment
Add comment · Show 3 · 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 Datapax · Sep 16, 2015 at 03:57 PM 0
Share

I actually set the "Bias" and "Normal Bias" to 0 on the spotlight and the problem was fixed. No more "Point Light Flashlights" ;D .... Hope this helps for others. Good luck!

avatar image Le-Pampelmuse Datapax · Oct 15, 2015 at 11:25 PM 1
Share

Buddy, I just wanted to update you on a completely working solution until Unity decides that spotlight have NO near shadow clipping, just like the pointlights:

Create a PointLight. Create a Cubemap with the Front(Z+) texture being the actual cookie you want to have, and the other 5 textures assign a plain black texture (check Alpha from Grayscale + Alpha is Transparancy). Assign the Cubemap to be the cookie for the light. It works like a charm since it is a pointlight.

If you don't want a characteristic cookie, just assign the "Default Particle" texture ;)

I will refuse to use spotlights until Unity is actually capable of todays standards in lighting (try the same in Unreal Editor, no problems at all, no clipping, nothing.)

I guess I will mention it in this thread when the day comes! Good Day to all of you

avatar image Le-Pampelmuse · Sep 16, 2015 at 10:47 PM 1
Share

Hahaha, I did something similar, i actually made a "real" flashlight. The cone part, that reflects the light forward in real life, had a hole and I attached a point light as a child to it. Voila. It works perfect, the rendering impact (Cubemap-Shadowmaps for Point Lights) is 100% unnoticable.

I have just been informed by a Unity employee that:

"Indeed, our spot light shadow rendering code was setting up near clip plane for shadowmap at 4% of the light range. So the larger the light range, the further away near clip plane was. We just made the change that makes the shadow near clip independent on the range, smaller by default, and configurable in light inspector. That will probably ship in Unity 5.3."

Well, ok so why did they decide that Near Clipping Distance is 0.04*Range ? -.- I don't even want to know!

Finally! Can't wait for that EPIC moment.

Next thing would be the ugly point light 4-circle artefacts that occur on nearby surfaces. xD

Thanks for taking the time to write that reply! Hope this reaches out tho anyone who suffered like us.

avatar image
0

Answer by pedja · Apr 03, 2015 at 05:18 AM

The only thing I found that helps at least reducing this problem is setting the range of that spotlight to much lower value, for example 5 (and you already know that). After that, you might increase light intensity a bit, just to get back similar level of light. Like LSPressWorks said, it's definitely happening when cone penetrates the object.

Comment
Add comment · Show 1 · 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 Le-Pampelmuse · Apr 04, 2015 at 08:55 PM 1
Share

Yes, thank you.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

6 People are following this question.

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

Related Questions

Low shadow quality from distance light 2 Answers

GameObject doesn't cast a shadow 3 Answers

Spotlight (player flashlight) causing point light range to "expand"? 1 Answer

Strange spotlight issue on rotation 0 Answers

what the ways to make a light visible in an scene? 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