Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 iHanzo · Mar 11, 2018 at 08:24 PM · lightingshaderssprites3d models

Help Turning Sprites into 3D Objects and Casting Shadows

Basically, I'm trying to make a game using 2D sprites that move in a 3D space. I'm trying to get a lighting effect like the one here, where characters are 2D sprites but cast shadows onto the 3D geometry. From what I've gathered, I need to turn my 2D sprites into a 3D object, since sprites won't cast shadows. I've tried a couple solutions but none have worked so far:


  1. Placing the sprites onto planes/quads and using those instead. This just hasn't displayed my sprites properly, and I feel like doing this would make animating sprites a nightmare.

  2. Using an external program (like Blender) to turn my sprites into planes and use those. The issue is I have no idea how to use blender or how I would animate using this, and haven't been able to find a tutorial that shows me what I want (and I don't really want to learn the entirety of blender just for this one thing).

  3. This one was just an idea, and I have no idea if it even exists, but using really thin voxels. Basically, if there's a voxel program that allows you to adjust the depth of the voxels that would solve all of my problems.


I really want to use this kind of lighting, and I've reached the point where I can't move forward in my prototypes anymore without figuring this out, unless I want to redo all my work. Any help is appreciated.

Comment
Add comment · Show 2
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 Rygaran · Mar 11, 2018 at 08:35 PM 0
Share

have you tried with a sprite renderer?

avatar image iHanzo Rygaran · Mar 12, 2018 at 03:20 AM 0
Share

I have, but sprite renderers don't cast shadows. That's why I want to turn my sprites into 3D models (that I can also animate), so that they can cast shadows.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by HarshadK · Mar 12, 2018 at 05:58 AM

Check out this thread about the same issue you are facing: Why can't Sprites gameobjects cast shadows?. It's a bit old but should serve the solve your issue.

Main takeaway from this thread is that shader used for sprites does not support shadows so you have to use a custom shader that supports shadow.

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 Harinezumi · Mar 12, 2018 at 08:32 AM 0
Share

I would add that towards the end of the thread they suggest a way without a special shader:
- in debug mode, enable cast shadows and receive shadows for the sprite renderer
- ins$$anonymous$$d of sprite renderer material, assign a standard material with cutout mode to the sprite renderer

I just tested this, and it works. I think it effectively turns your sprite renderer into a mesh renderer with a quad mesh, so there is probably a performance impact for it.

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

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

Sprites not working with Depth of Field Post Processing 0 Answers

Correct Workflow (QC fbx to Unity) 0 Answers

How to get 2d lighting data in shadergraph? 0 Answers

Limit Amount of Light Applied to Sprite 0 Answers

texture looks pix-elated where-ever there is shininess and lighting 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