• 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 Kitcheone · Nov 12, 2016 at 05:17 PM · androidgeometryhard shadows

Hard shadows glitching geometry in Android

I've noticed in my recent builds that when I enable hard shadows on a point light, all of the geometry in the scene goes a bit crazy. However, this only happens in Android.

Here's a screenshot of the game running on Android with real time shadows disabled:

No shadows

And here's a screenshot of the game running on Android with real time shadows enabled:

Broken shadows

As you can see, all of the geometry is completely messed up when hard shadows are enabled.

Things to note:

  • In the Unity editor (and on iOS), the real time shadows work completely fine.

  • I've been building this game for a while. In the past, the real-time shadows worked on Android completely fine. I've only noticed recently that they cause this glitch, as I haven't turned the shadows on in a long time. So I'm unsure when this glitch started happening, but I can confirm that it did used to work OK at some point in the past.

  • This is on Unity 5.5b11, but I've also tried building in 5.3 and 5.4, and it has the same issue.

  • EDIT: After doing some more testing, I can confirm this problem doesn't affect directional lights. A directional light in this scene with shadows set to "Hard" casts shadows properly, and it works OK. As soon as I switch it to a point light, it starts showing the same messed up geometry as in the picture.

Any ideas what's wrong? Any suggestions on how I might fix this?

Thanks in advance.

shadowsbroken.jpg (520.9 kB)
noshadows.jpg (457.6 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by IgorAherne · Nov 12, 2016 at 07:37 PM

couple of guesses:

1) check the distance of light, it might get glitchy shadows if it's very big (above 500)

2) see if enabling cascades helps in Project->quality settings of the game

3) play with "Bias", "Normal Bias" and "Shadow Near Plane" settings of the light

3.5) shadow distance in Project->quality settings shouldn't be above 1000

4) perhaps the material's shader is broken after the update

5) check camera's near and far clipping planes, they shouldn't have a difference larger than 500 ish

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 Kitcheone · Nov 13, 2016 at 11:16 AM 0
Share

Thanks for the help and all the ideas. Unfortunately I couldn't fix the problem through any of your points. Here's an update on each one:

1) The range of the light sits somewhere between 10 and 20 (varies depending on how close to the ground it is). But it never goes above 20.

2) Cascades are already enabled, and set to "Two cascades". I've also tried it with no cascades and four cascades, but that didn't fix it.

3) I've played around with the "Bias" / "Normal Bias" / "Shadow Near Plane" settings, but the problem still occurred regardless of what settings I picked

3.5) The shadow distance is set to 20. I've also tried it on 50 and 100, but it made no difference.

4) The material is just the standard Unity material. I will try some others and see if it breaks similarly or not.

5) The camera planes were set to 0.3 and 1000 for near and far respectively. I lowered the far plane to 100, but it didn't fix it.

Thanks again for your input.

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

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Android: No geometry appears? 0 Answers

Too much triangles and more doubts performance-related 1 Answer

Connect to Remote SQLServer DB in Android? 1 Answer

Displaying 2d graphics (sprites) on Android with ETC and alpha channel 1 Answer

whatever happens, may be quit application or start again, after 10 minutes, I want to do something. I have to run on adroid. 2 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges