Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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
0
Question by Sir-David-III · Feb 16, 2018 at 04:25 PM · uirenderingunity5shadows

Receive shadows on "Screen Space - Camera" canvas

Hello!

My scene consists of a dice box (Constrained space for dice throwing, transparent), but main interaction is done through the "Screen Space - Camera" UI canvas. The problem is that this type of canvas ignores shadows, and if you throw dice in the dice box on top of it, it looks like a dice is floating even after landing, because there is no shadow. I would like to make it render. I would appreciate pointing in the direction of a solution.

Here is how it looks (Gray is representation of UI): alt text

Here is how I want it to look, but without prototype texture: alt text

Thanks in advance!

e1.jpg (11.8 kB)
e2.jpg (22.5 kB)
Comment
Add comment · Show 3
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 TreyH · Feb 16, 2018 at 06:05 PM 0
Share

Have you tried making a world canvas that is a child of your camera?

avatar image Sir-David-III TreyH · Feb 16, 2018 at 07:06 PM 0
Share

Yes, but it does not render shadows on itself too, and it is not fit for purpose moreover

avatar image TreyH · Feb 16, 2018 at 10:04 PM 0
Share

Have you considered just faking it with a black shadow UI element as a child of your die?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by SunnyChow · Feb 16, 2018 at 05:22 PM

You description is confusing. What are doing? Are you rendering things on RenderTexture? Or are you parenting the 3d GameObject onto the UI elements?

if it's case 1, the shadow is rendered on the RenderTexture, but the alpha channel is kept as zero. You need some custom shader to adjust it.

if it's case 2, UI default shader doesn't receive shadow. you need to write a ui shader that receive shadow

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 Sir-David-III · Feb 16, 2018 at 05:26 PM 0
Share

I have all interactions done at UI canvas, dice box is 3d and is always at top. It's only goal is for throwing dice, for it to look fancy and stuff. But dice doesn't cast shadows on canvas. I thought there could be another way of doing it, except for the shader writing, guess will have to look into it some day or another. Anyway, thank you!

avatar image Sir-David-III · Feb 16, 2018 at 07:07 PM 0
Share

And no, dice box is independent object

avatar image
0

Answer by Harinezumi · Feb 16, 2018 at 09:56 PM

It is perfectly fine to use multiple cameras in a scene (as long as only one has AudioListener on it), then order them with their camera depth property. So in your case I would have a camera that just renders the 2D UI, and then another camera, above the UI, that renders the 3D dice over a 3D box.
Would this approach do what you are trying to achieve?

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

140 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

Related Questions

IOS Unity 5 spike in "RenderShadowMap 1 Answer

How to attach a (that world type) canvas to a moving player? 0 Answers

Shadows in my rendered "Portal" Don't Render 0 Answers

All UI getting pink in windows 1 Answer

Native Rendering Plugin with UI Image 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