• 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 Monkey_of_Doom · Oct 04, 2011 at 12:32 PM · shadows

Shadow Casting Distance

How do you change the distance at which shadows cast on objects?

Right now I have a helicopter, which is actual scale in centimeters, that the rotor doesn't cast a shadow on the body of the helicopter until about halfway down the nose. Another example is the outside of the aircraft not casting a shadow on the floor of the inside, instead I get the rotor shadow. It seems the distance between the objects is the issue since raising the rotor up makes the shadow climb up the helicopter until it completely appears after the rotor is floating above the body.

Any ideas?

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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by yeoldesnake 1 · Oct 04, 2011 at 01:59 PM

Edit the shadow distance at the quality settings. Be careful though as very high values tend to make shadows look less detailed.

You can alternatively scale everything down , including the world , so that the distance between rendered objects is smaller.

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 Monkey_of_Doom · Oct 04, 2011 at 04:50 PM 1
Share

Thanks for the suggestion, unfortunately, neither seemed to work. The shadow distance adjusts how far from the camera shadows are visible, not the actual distance that objects throw shadows. And scaling down had no effect. The shadows cast the same way.

I got curious and messed with the scene's lighting in my own copy of the file and it turns out that the directional light's angle needed to be completely perpendicular to the helicopter. The more I adjusted the angle from 90 degrees, the more the shadow broke apart and disappeared. I think this must be a bug of some kind, because I don't think I should only be able to cast accurate real time shadows at a 90 degree angle.

avatar image
0

Answer by hellcats · Oct 04, 2011 at 07:17 PM

There is a "shadow bias" setting on the light. You might trying adjust that. But most likely the problem is your world scale. You say your helicopter is actual scale in centimeters. Is it a R/C model helicopter? If your objects are all just fractions of a "unit" in size, then this could affect shadow and possibly collision detection and other things. Unity is not entirely scale independent and you should attempt to have your objects be multiples of a "unit" and not just tiny fractions of it.

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 Monkey_of_Doom · Oct 04, 2011 at 07:48 PM 0
Share

No it is not an R/C copter. It is actual scale of a real UH-60. So in real world measurements it is 1976cm. It is a 1:1 model. Adjusting the shadow bias did not do anything either. I have played with all the settings in unity and so far none has fixed the issue. The only fix I can find is to make the light perpendicular (90 degrees) to the model. The further I get away from 90 degrees, the more the shadow falls apart. I originally thought it was a distance issue, but it seems the rotation of the light is part of the problem.

avatar image
0

Answer by yeoldesnake 1 · Oct 05, 2011 at 02:33 PM

Seeing that both of the previous solutions didnt solve the problem , you should check if your model normals are imported improperly.

In your helicopter's import settings you can try setting the normals to "Calculate" and see if this fixes the problem.

Comment
Add comment · Show 6 · 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 Monkey_of_Doom · Oct 06, 2011 at 08:12 PM 0
Share

I tried changing it from imported to calculate, but no difference. I tried posting the question over in the forums as well, here is a link to that. It has screen shots that show what I am describing. What I've found is that having the light at exactly 90 degrees is the only way to fix the problem. Any angle at all and the shadows fall apart.

I am getting an error on import that says Unity can't import tangents and binormals because none of the objects have them. I have tried exporting just a cube and plane and get the same error, and also the same effect with the shadows. I've tried triangulating the mesh in $$anonymous$$ax, and still get the error. I'm kinda at a loss here.

avatar image Monkey_of_Doom · Oct 07, 2011 at 11:29 AM 0
Share

Seems I forgot the link: http://forum.unity3d.com/threads/106874-Real-Time-Shadow-Casting-Help

avatar image syclamoth · Oct 07, 2011 at 11:40 AM 0
Share

Nice helicopter model! Back to the topic, how big is the model in Unity? What's your shadow distance in the quality settings? $$anonymous$$ake sure that it isn't set too high- you might end up having problems because of that.

avatar image Monkey_of_Doom · Oct 07, 2011 at 03:16 PM 0
Share

I can't take credit for the model. We purchased the base model and have been converting it to a different model Blackhawk.

As for the size, it is 100% in $$anonymous$$ax, so it is 1976 cm. On the import, we have the scale set to .01 so that it converts to meters in unity. I've played with scale, shadow distance and shadow bias to no effect. I was able to correct the binormals/tangents error on import using a newer version of $$anonymous$$ax and FBX exporter, and again, that did not solve the problem.

If I make a cube and plane in Unity, the shadows work fine, but anything I bring in from $$anonymous$$ax has the same problem with the shadows.

I have the quality set to Fantastic. Shadow distance has no effect, other than to go completely away if I turn it too low.

I can't figure this out. It seems to have something to do with meshes from $$anonymous$$ax, but I don't know what else I can do to correct the problem.

avatar image syclamoth · Oct 07, 2011 at 03:39 PM 0
Share

Unity is dimensionless, so meters or centimeters don't actually mean anything. Also, as for the quality settings, I've found that shadows from directional lights actually look a bit worse on fantastic, because the extremely long shadow length means that even at maximum resoloution, the shadows get grainy close up. However, from the screenshot you posted earlier, I don't think that's the problem...

Show more comments
avatar image
3

Answer by WooArt77 · Sep 19, 2012 at 08:37 PM

Perhaps you could try adjusting the quality sitting of your lighting.
Edit>Project Settings>Quality
From there you can adjust the "Shadow Distance" among other things. There are a bunch of other settings there you could fiddle around with. Perhaps there may be something there.

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 Tom Lin · Dec 04, 2013 at 02:40 AM 0
Share

Thank you, this really helped me.

avatar image jimjames · Dec 14, 2015 at 08:39 PM 0
Share

Same Here. Thanks

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

8 People are following this question.

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

Related Questions

Jagged shadows on some angles 1 Answer

realtime light breaks baked GI 1 Answer

Shadow Strength = 0 vs Shadow type = No Shadows 2 Answers

影がきれいに落ちない。The shadows do not fall clean. 0 Answers

How do you stop shadows from casting through meshes? 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