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
2
Question by Derpybunneh · Sep 03, 2016 at 09:06 PM · shadermaterialdarkwhats-wrong

Sprite Diffuse Material makes sprite black

Hello! So when I'm trying to apply a diffuse shader sprite material to my sprites, it makes it go completely black. The lighting has no effect upon it. What's up?

I'm using a directional light in my scene, because none of the other lights seem to work. What's strange is that this same shader works on other sprites well, but not on certain objects.

With lit sprite shader alt text

With sprite diffuse alt text

with-shader.png (24.2 kB)
without.png (11.7 kB)
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 tanoshimi · Sep 03, 2016 at 09:32 PM 0
Share

$$anonymous$$ore info needed: what lights do you have in your scene - directional, point, spot? Forward or deferred rendering? A screenshot of your scene view would probably help to diagnose the problem.

avatar image Derpybunneh tanoshimi · Sep 03, 2016 at 10:16 PM 0
Share

Updated with more info. See above.

2 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by alexjhones286 · Mar 27, 2018 at 03:25 PM

Your posting is old, I think it's already solved the problem, but I'm putting it here to help anyone looking for the answer as I was. (I.e.

Windows> Lighting> Settings It will open a window, on the Scene tab, look for Ambient Color and set it to white. :) I used Google translator, sorry for English. ' :) Brazil here'. :)

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 hardanger · Jul 27, 2018 at 07:42 AM 0
Share

thx man :)

avatar image
0

Answer by naviln · Apr 22, 2019 at 12:51 PM

I was having a similar problem, what i didnt realize was that i had random z indexes on my game objects. This caused my light source to sit behind my objects and not cast light on them properly.


Setting my project to 3d (temporarily), and zooming around my scene in the editor really helped me understand what was going on. Even if your project is 2d, like mine, you can still do this.


Anyway, once i saw what was happening, i just had to adjust the z value of my camera to a negative value, less than what my objects were (so i tried -10 and kept going backwards until it started showing).


I also went through all my gameobjects that i wanted to light to hit, and manually set the z indexes to all of them to zero, and ensured that whenever i adjusted their localscale using code, i used Vector3 and set the z index (third parameter) to 0 as well.


You can try this - switch to the rotate tool in the editor and swing them randomly around until you see it hit and light up your object. This was useful for me to better learn how it was working.


Another thing to consider is the shader/material. If your gameobjects are using a material, make sure that material has a shader that supports lighting. I switched my material to use the UI/Lit/Bumped shader, which worked well for me.

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.

Follow this Question

Answers Answers and Comments

78 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

Related Questions

Material doesn't have a color property '_Color' 4 Answers

Changing Eye Colour (Colour only non-white parts of a texture?) 2 Answers

GL - Shader not working in Android 1 Answer

Is it possible to modify a material/shader in code? 1 Answer

Control materials opacity. 2 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