Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 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
0
Question by Yaza · Mar 02, 2017 at 02:03 AM · 2d gamespritesshadowdynamiccel shading

Creature Editor - Sprite Cel Shading/ Dynamic Hard Shadows

Hi everybody,

I'm working on a 2D game with a creature editor, where you can attach, move and rotate bodyparts as you like.

It would be awesome if I could dynamically calculate and draw hard shadows on my sprites, like shown in the picture below: alt text

The problem is, that the players can rotate and mirror bodyparts, that's why I can't draw the shadows directly on the sprites (e.g. both creatures above use the same body but with a different rotation).

So now I'm looking for a way on how to create this look. Options I thought of are:

  1. Directly manipulate the sprite pixels and somehow calculate which should be colored in a darker color.

  2. Use a Cel Shading shader and a normal map for each bodypart.

I have no idea if one of those two options would work, I'm especially unsure about the shader approach. I don't know enough about shaders to say if this is possible and how well it will turn out.

What do you think of my approaches or have you got any other ideas on how to archieve this effect?

I'm grateful about every answer!

spritecelshading2.png (53.7 kB)
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
1
Best Answer

Answer by Yaza · Mar 03, 2017 at 03:51 AM

Ok I kind of figured something out, using Sprite Masks in the experimental 2D build. They don't work for all the bodyparts, but I think I can improve it further to work for the majority of them :) Exceptions are complex parts like the snail shell, bat wings and the hair.

alt text


2017-03-03-03-23-14-unity-550x3-2d-build-personal.png (399.1 kB)
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 GabrielDeSouza · Mar 22, 2019 at 09:26 PM 0
Share

Please, can you share how did you achieve this result? I need something like this for a game project. $$anonymous$$aybe I can even help you!

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

68 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 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 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

My Enemy object disappeared when fliped it 1 Answer

Gap between objects and its shadow 0 Answers

What happens when i select for android "ETC1 (split alpha channel)", but disable sprite packer for builds 0 Answers

How do you fix a sprite to a camera that follows another sprite, but still be able to move it? 0 Answers

Dynamic objects lighting and rendering (exterior scene) 3 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