• 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 TFE · May 03, 2014 at 06:03 PM · 2dshadows

How do I achieve dynamic shadows in a 2d game like Thomas was alone

How do I get shadows in my 2d game like the ones in Thomas was alone? There is a video demonstrating what I mean right here

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 NoseKills · May 04, 2014 at 12:02 AM 0
Share

There is a cheapish plugin available for that.

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by slembcke2 · Jan 12, 2017 at 08:37 PM

The Asset store can certainly help here if you don't want to spend a lot of effort: https://www.assetstore.unity3d.com/en/#!/list/1354-lights-2d-resources

(Kind of a shameless plug as we wrote Super Fast Soft Shadows on that list)

If you are looking for another option to implement it yourself, I'm a big fan of this method, and it sounds like it's the same one as Thomas Was Alone according to tanoshimi: http://archive.gamedev.net/archive/reference/programming/features/2dsoftshadow/

I've been using the hard shadow method for over a decade with great results. You can trivially perform the shadow projection with a matrix. SFSS is an extension of the hard shadow algorithm with some shaders to render the penumbras accurately instead of using the finicky/tedious/innacurate shadow fins from that article.

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
4

Answer by tanoshimi · May 04, 2014 at 09:06 AM

Actually, Mike Bithell recently tweeted that he did the lighting in TWA "stupidly" - using planes and moving their vertices based on lighting calculations

https://mobile.twitter.com/mikeBithell/status/462194109588193280

update: Seeing as this thread has resurfaced nearly three years later, I'll point out that there are now plenty of free (and, even better, open source) alternatives. A quick search of "Unity 2D dynamic lighting" on GitHub will produce gems like this, for example: https://github.com/f15gdsy/2D-Light-of-Sight-Unity

alt text


los-full-screen-light-0.png (21.2 kB)
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
4

Answer by Clonkex · May 04, 2014 at 02:40 AM

In Thomas Was Alone, the game was rendered in 3D, despite appearing 2D, which meant it was easy to cast shadows. Red Blob Games (as always) has some really awesome information and tutorials on how to achieve this effect in 2D: http://www.redblobgames.com/articles/visibility/
http://simblob.blogspot.com.au/2012/07/2d-visibility.html

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

24 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

Related Questions

Disable angular shadow recieving in 2D? 0 Answers

Dynamic shadows in orthographic camera. 2 Answers

Prevent 2d light from leaking through walls 0 Answers

Shadow bug 0 Answers

How can I fix URP 2D shadow for sprites?,Issues with 2D shadow casting in URP 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