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
0
Question by anil.gautam · Jun 26, 2012 at 07:22 AM · shadowlightning

whats prevent shadows from coming

I am not able to produce shadows in unity 3d pro. I have tried with both hard and soft shadows. But not able to see shadows .I also want to produce realtime shadows and detect shadows. whats preventing shadows from coming.

I have attached the scence with my question. link text

shadows.zip (4.1 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 Freezy · Jun 26, 2012 at 08:09 AM 0
Share

Have you read: http://unity3d.com/support/documentation/$$anonymous$$anual/Shadow%20Troubleshooting.html

avatar image anil.gautam · Jun 26, 2012 at 08:44 AM 0
Share

I have read this already and done all the required settings. But still not able to see any shadows. and I also want to detect shadows as well using script.Thanks

avatar image Freezy · Jun 26, 2012 at 04:46 PM 0
Share

Best solution for directional lights is to just detect a certain angle of rotation of the directional light for static objects.

For other light types try to deter$$anonymous$$e ways to get the information you need without actually relying on knowing actual light information.

If you just need the shadow information for a visual effect (but not a game mechanic) then solve it with a shader.

Shadows are created only in the rendering pipeline (or baked into a lightmap in the editor). You can't easily get the amount or even if a object is receiving a shadow.

For realtime random light shadow tracking you would need:

  1. A system to cast rays to check if there is a direct unobstructed line to every light source.

cast a ray toward the inverse direction of your directional light or towards the position of a normal light

Detect if there is a collider in the way, if a collider is hit you have a shadow. If there is a ceiling or something behind the light, use a radius 1 collision sphere on the light. On collision ask for the light, if there is none -> shadow

For performance I also recommend:

  1. A system to not have to do complete step 1 for every inch of every object every frame.

  2. A system that seperates step 2 into smaller chunks allowing for smaller updates (number of rays per frame, next frame does the next batch, next frame does the third batch etc )

An alternative would be to render the scene with a replacement shader that renders only the shadows in white to a render texture, then use some math to figure out the point in which you are interrested and check if the pixel is white.

For the rest you will need to open up new questions ;-)

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Freezy · Jun 26, 2012 at 09:27 AM

Do not use the built in default diffuse, it has no shadow support apparently. Create a material, diffuse shader, optionally assign a color.

Shadow should now appear at least in game view.

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 anil.gautam · Jun 27, 2012 at 07:20 AM 0
Share

I have used materials and assigned the color still not able to see any real shadows

avatar image
0

Answer by Meltdown · Jun 26, 2012 at 05:24 PM

Click on your light, and make sure you set it to have shadows. Also check your quality settings. Project Settings -> Quality. You may be on an editor quality setting that has shadows disabled.

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 anil.gautam · Jun 27, 2012 at 07:20 AM 0
Share

I have checked all the setting but not able to see any shadows in my game .I also want to detect my shadows as well when it is lying on object and when object is in direct contact with sun

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Trees done by brush won't cast a shadow? 0 Answers

Shadow Demo in Unity 3 Pro 1 Answer

Why is shadow going through a part of a wall? 1 Answer

Unity Custom CutOut Shader 1 Answer

Toon Shader Not Working With Multiple Spotlight Shadows (Pro) 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