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
1
Question by PrawnJeremy · Aug 20, 2013 at 11:10 AM · lightingshadowsreal time

How to cast real time shadow from object without illuminating it?

I am trying to figure out how to cast real time shadows from an object without adding to the illumination of the object.

I have one directional light setup for the shading of my object, set not to cast shadows because it is angled and I want my shadows to be top down, not skewed into the background.

I can add a second directional light, pointing down, set it to cast shadows and get real time shadows from the object, the problem is, in order for it to cast shadows, I have to allow it to illuminate the object which messes up my shading :/

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
0

Answer by Xtro · Aug 20, 2013 at 02:13 PM

use an "unlit" shader for the object.

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 PrawnJeremy · Aug 20, 2013 at 09:08 PM 0
Share

That would break my shading and the entire style of the game. I need to keep the shader I am currently using. So far I am seeing three options, I would like option 2:

1) The highly expensive way I would like to avoid: duplicate the object on top of itself: render the first one with my toon shader without any shadows, and then render the second one with the other directional light only (using layers) with a shader that only renders shadows.

2) Find out from someone that knows a lot about shaders if it is even possible to have one shader that takes illu$$anonymous$$ation only from one directional light and shadows only from a second directional light and figure out how to update the shader I am using.

3) Give up and use blob shadows :/

avatar image Xtro · Aug 20, 2013 at 10:32 PM 0
Share

what, you said you don't need lighting on the object. if there is no lighting on it? how do you shade it ? does its shader have lighting function? can you edit the shader to remove that function ?

avatar image PrawnJeremy · Aug 21, 2013 at 01:10 AM 0
Share

Sorry, I apparently wasn't very clear. I in fact have a directional light setup to illu$$anonymous$$ate the object. I need to add shadow and shadow only, from a second directional light.

I am using the Toony Colors Pro shaders from the asset store. They are heavily affected by the angle of the lighting. So I setup a directional light at an angle to create the look for the illu$$anonymous$$ation shading I want. However, that angle produces bad, stretched shadows, so I cannot allow that light to cast shadows. I ins$$anonymous$$d need to have the shadows cast from a second "light" whos only purpose is to cast shadows, adding no illu$$anonymous$$ation to the object.

I don't know much about editing shaders. A good starting point would be knowing if it is even possible to set one up such that: Light A: illu$$anonymous$$ates the object without casting shadows from it Light B: casts shadows from the object without illu$$anonymous$$ating it

avatar image Xtro · Aug 21, 2013 at 01:54 AM 1
Share

hmm I think this is not possible. in software world, I never say impossible but in unity's shading system, it looks impossible to me :(

avatar image PrawnJeremy · Aug 21, 2013 at 02:01 AM 0
Share

Aye, thanks for the replies though :) $$anonymous$$aybe someone else will jump in with some voodoo answer that forces it to work lol.

Anyway, in case you are curious, you can see an early WIP of the game I am working on (currently with blob shadows) here (I'll make a Unity forum thread soonish): PJ WIP

Show more comments

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

16 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

Related Questions

How to make a GameObject not hittable by shadows ? 2 Answers

Terrain Baked and Realtime lighting 0 Answers

How to solve Peter Panning (shadow offset) problem? 1 Answer

Strange Box Shadow Emitted by Point Light 0 Answers

Shadows produced by non-static objects are lighter than baked shadows 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