Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Scribe · Dec 10, 2010 at 07:33 PM · lightingpluginshadow

Any way of getting shadows in Unity Indie

Hi again, I know that there are no dynamic shadows in the non-pro version of unity however does anyone know of a way around this. I am trying to make a scary game and so shadows are very important for this.

what I am looking for are:

any downloadable addOns enabling dynamic shadows

Work arounds possibly using raycast or linecast to check if there is something in the way of the light(don't mind if it is complicated but if it is code please make sure it is javascript)

Anything that is vaguely useful for creating shadows of complex shapes or just a plain, definite answer that it is not possible so I don't waste anymore time trying

Thanks for your help

Scribe

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

2 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer Wiki

Answer by skovacs1 · Dec 10, 2010 at 07:57 PM

Unless your shadows need to be dynamic (which usually they actually don't need to be, you should consider:

  1. Baking your lighting in another program. Into the textures or into lightmaps. This is one of the best solutions.
  2. Shadow projectors.

If you really need dynamic shadows, you might try:

  1. Animated lightmaps. Can be quite expensive, depending on your setup.
  2. Animated Shadow projectors
  3. Writing a shader that projects backfacing vertices back into space to create shadow volumes. Can be complicated, expensive and suffers many other limitations.
  4. Defining meshes at run-time to create custom shadow volumes. Even worse than writing a shader to do it.
Comment
Add comment · Show 4 · 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 Scribe · Dec 10, 2010 at 08:17 PM 0
Share

Thanks a lot, I'm planning to make monsters run across the walls and throw large shadows so I think I definitely need dynamic shadows. You gave a lot of detail so i'm going to do some further research into your suggested methods. Thanks again.

avatar image skovacs1 · Dec 10, 2010 at 09:41 PM 2
Share

Hmmm. Throw large shadows as projectiles? I would recommend a particle system in that case. Or do you mean it as in casting large shadows? Bear in $$anonymous$$d that shadows are made large by proximity to the light source. Something you could try is a shadow projector which changes fieldOfView based on your proximity to the light and rotation based on direction to the light source. Of course that won't adjust if your shadow casters turn such that the shadow doesn't properly represent their contours. To compensate, you might have an animated texture advanced based on orientation, but that's a pain.

avatar image Scribe · Dec 11, 2010 at 12:06 AM 0
Share

I have already been trying to figure out a way of making the projector field of view adjust as the distance changes just with a plain sphere but I haven't managed to get very far. I was trying to find the extents and make them the use them to adjust the field of view but it didn't work (I'm not that great at scripting but getting better) I will continue adjusting my scripts for this technique if you think it might work.

Just out of interest is there no way of using raycasting to say for example: If raycast hits, allow light to hit this surface if raycast is blocked by something don't light up

avatar image skovacs1 · Dec 13, 2010 at 03:30 PM 1
Share

A raycast would be a fairly costly way to do it as you would have to do it for every light and every shadow projector. A cheaper way would be defining a simple volume for the lights, adding the projecting objects when they enter the volume and removing them when they leave. Updating the projector would be done based on a simple subtraction of the positions of the two objects. The magnitude or magnitude squared of this result can be used to deter$$anonymous$$e distance, and this result is the direction to cast the shadow.

avatar image
3

Answer by yoyo · Dec 10, 2010 at 09:23 PM

Casting shadows onto a ground plane is easy. It doesn't handle the project-on-wall case you want for your game, but might be useful in some situations.

There's an article in Game Programming Gems Volume 1 that explains ground plane shadows. (The technique could potentially be generalized for other planar shadows.)

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 Scribe · Dec 10, 2010 at 11:58 PM 0
Share

Thanks for the link I will continue to read it as i haven't got very far yet

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

No one has followed this question yet.

Related Questions

Object drops shadow without accepting light 1 Answer

Shadows pass through meshes after baking 0 Answers

Custom Lighting shader issue w Spot/Point lights and atten 0 Answers

What is this lighting issue? 1 Answer

problem on light and shadow 1 Answer


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