Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 britsplease · Mar 28, 2015 at 04:50 PM · 2dmateriallightmeshrendererdiffuse

Directional Light seems to have no effect on MeshRenderer.

In my 2D project I have some GameObjects with MeshRenderer components generated by script. The renderer use a Sprite/Diffuse material. The other properties of the renderer are the following (although I've tried to change everything): alt text

I also have a Directional Light in my scene which Baking is set to Realtime.

My problem is that the meshes are too dark. It seems that the Intensity and the Z position of the Directional Light has no effect on it. Objects with SpriteRenderers are affected by changing the Intensity. Also, my MeshRenderer objects are affected by Point Lights.

What am I doing wrong? How can the MeshRenderer be correctly used with Directional Lights?

rendererproperties.png (11.2 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 Lilbob · Mar 29, 2015 at 02:28 AM 0
Share

Have you tried testing your scene with the mesh renderers already on the objects when you start? Have you tried changing the direction of the directional light? Lastly, I see a sprite mat on your object. have you tested it with a different $$anonymous$$at?

avatar image britsplease · Mar 29, 2015 at 06:02 PM 0
Share

I didn't find any other material which makes the desired look. Changing the direction of the light did not help either.

I put a plane mesh in the scene and it was lit correctly. I found out that when I rotate it by 180 degress around the X or Y axis, the light has no effect on it, like on my generated meshes. I thought I need to rotate my meshes so I changed their normals by changing the orientation in the mesh triangles. This didn't help either, same effect.

Later I found out that the meshes start being lit when I move them closer to the camera. This is independent from the position of the light or any other objects. I am out of ideas for now..

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by barjed · Mar 29, 2015 at 07:33 PM

This might sound like a long shot but did you try rotating the directional light (try all three axes), so that it shines at an angle?

I think the default rotation of sprites is perpendicular to directional light's rotation, so that's why it might be affecting those.

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 britsplease · Mar 31, 2015 at 10:15 PM 0
Share

Interesting, when the direction of the light is not perpendicular to the Z plane, parts of the meshes are lit - but the regular sprites get darker, of course.

This is confusing for me since in my original case it seems like the light comes side-on to the normal vector of the meshes and they are head-on when the light is parallel to the z plane. I thought the normals are calculated from the triangles which consist of vertices and each of my vertices are on the z plane so the normals should be perpendicular to it. Am I missing something important here?

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to make sprite to react to light? 1 Answer

Material is destroying sprite`s quality 1 Answer

2d Lighting - Weird light triangles 0 Answers

How to use different Materials in one Mesh? 0 Answers

batch MeshRenderers with same material but different alphas 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