• 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 jvisenti · Jun 17, 2018 at 08:34 PM · ioslightingshadowsmultiple camerasrealtime-shadows

Behavior of Realtime Shadows on iOS

I'm attempting to simplify rendering of a complex 3D scene by using a screenshot as a backdrop behind a few dynamic models. The dynamic objects cast shadows onto an invisible plane using a technique adapted from https://github.com/keijiro/ShadowDrawer. The setup looks like this:


Unity 2017.4.2, forward rendering

- Screenspace camera canvas with backdrop image, rendered with camera depth -1, clear solid color

- Dynamic models casting realtime shadows from a single directional light, rendered with camera depth 0, clear depth only

- Screenspace overlay UI canvas


Everything looks good when run in the editor, but when running on iOS the entire scene behind the 3D models is black. If I deactivate the models, the backdrop shows, but obviously no models or shadows are rendered. If I turn off shadows on the light, the scene looks correct except obviously no shadows are rendered.

What might differ in the implementation of realtime shadows between desktop and iOS to cause this behavior? I'd really like to keep the realtime shadows, so any suggestions or workaround is appreciated.

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
Best Answer

Answer by jvisenti · Jun 18, 2018 at 10:44 PM

Solved the problem in a different way using a single camera. The camera now renders all layers and the background is simply a Screenspace Camera canvas with an image that uses a clone of the UI default material, but with Geometry - 1 render queue. With this setup the background is rendered first, and the realtime shadows appear correctly on top of it.

Still curious why the first setup didn't function properly, I'm thinking it's a Unity bug.

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.

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

141 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 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 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

Optimize Shadows for Moving Light 0 Answers

Very Strange Realtime Shadows 0 Answers

Shadows disappear when using Pro Image Effects or HDR 2 Answers

Proper indoor lighting without directional light 0 Answers

What if you really, truly want real-time shadows on iPhone/iPad? 3 Answers

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