Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
2
Question by Xleek · Nov 30, 2012 at 12:56 AM · lightshadowlayer

Cast two shadow from object in different layer on same plane

Hi all,

Here is my situation at the moment, beginning with Unity, I tried to search here and on the internet, and the doc but couldn't find what i'm looking for :

(I am using unity pro.)

I have two object A and B, each with a mesh and with "cast shadow" enable. Each object is in a different layer (let's say layerA for object A and layerB for object B). The problem I am encoutering is that I want to cast (with dynamic shadows) both object's shadow, on the same surface (let's say a wall.) (because I need to handle separatly the intensity and the color of shadows separatly)

The way I proceed is the following: I am using two directional lights, one culling the layerA, and the other culling the layerB. But it only display on the surface only one of the two shadows... (In fact, the same layer as the plane)

I think I know why it doesn't work, but I don't how if it's even possible to achieve what I'm looking for...

Any suggestions ? Thanks

PS: I set light mode to deferred rendering and not forwarding.

Comment
Add comment · Show 1
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 NateJC · Jul 28, 2016 at 08:56 PM 0
Share

I have this same problem. Did you ever find a solution?

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by wip · Aug 10, 2014 at 04:05 PM

Maybe this discussion will help you: http://forum.unity3d.com/threads/is-there-a-way-to-cast-shadows-from-one-layer-onto-another.196125/

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
avatar image
0

Answer by NateJC · Jul 29, 2016 at 04:50 PM

I figured out a workable solution for my case:

1) Make a parent game object that has the collider & rigid body

2) Now add two nested children to it, each with the same Mesh + Mesh Renderer components

3) Name one of them "View" and the other "Shadow Only"

4) For the View object, use these settings:

alt text

5) For the Shadow Only object, use these settings:

Shadow Only Settings

6) Now apply all physics & animations to the parent object, and everything else should work naturally!

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 cubrman · Jan 30, 2017 at 09:00 AM 0
Share

The problem with this solution is that you have to add the same model into the scene twice every time you need this effect. It is ofcourse possible to semi-automate this via a script, would be great though to have a more elegant solutuin.

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

15 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

Related Questions

Soft Shadows are hard... 1 Answer

no shadow with until texture ?? 2 Answers

Making Sprites Darker / Shadowed? 1 Answer

Shadows and lights are flashing and disapperaring when player is moving 0 Answers

only dynamic shadow without its light projection? 2 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