• 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 ronronmx · Sep 02, 2012 at 06:16 AM · shaderlightingshaderlab

Lighting breaks when zooming in

I have been experiencing some weird behaviors with lighting in my scene lately, depending on the my zoom level (in editor), my objects get completely blown out from the lights, really bright:

NORMAL

alt text

BROKEN

alt text

I should mention that I'm using custom shaders, but i never had that problem before. What could I have broken in my shaders that would introduce this behavior? They're nothing fancy, just some custom vertex lit shaders, and the only thing I can think of is maybe I'm not using #define UNITY_PASS_FORWARDBASE correctly, or something like this. I could be completely wrong of course :)

Any tips would be very welcomed, as I have no idea why it's happening all of a sudden...

Thanks guys!

Stephane

screen_good.jpg (51.2 kB)
screen_bad.jpg (39.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
0

Answer by Kryptos · Sep 03, 2012 at 09:05 AM

This looks like double lighting. Can you show use your shaders?

Also note that since Unity 3.5.1, realtime lights work differently (fixing a bug):

In Unity 3.4 realtime lights were not affecting static objects. In Unity 3.5 realtime lights always affect static and dynamic objects.

The result of this is that if you had previously setup your lighting to work around this bug, then you will now get worse performance as you will receive the lighting twice. It will also look different since your lights will be added twice to the scene.

The correct way to use these lights is to use a single auto directional light and remove the realtime only light.

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 ronronmx · Sep 03, 2012 at 11:29 PM 0
Share

Nicolas, I wasn't aware of the change since Unity 3.5.1, thx for the heads-up :) This was my problem though, my lighting wasn't setup to work around that bug. I'm pretty sure I fixed it by changing all my Passes to "Tags { "Light$$anonymous$$ode" = "ForwardBase" }" ins$$anonymous$$d of "Tags { "Light$$anonymous$$ode" = "Vertex" }" and adding "#define UNITY_PASS_FORWARDBASE".

Now my lighting doesn't change or get blown-up anymore when zoo$$anonymous$$g in so that must have been it. I had some shaders using Vertex Light$$anonymous$$ode and some other using ForwardBase, while the source code had ""#define UNITY_PASS_FORWARDBASE" setup, and I think it was messing things up for me. Although I cannot be sure, it's the only explanation I can come-up with since everything seems to be working fine now!

Yay :)

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

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can someone help me fix my Javascript for Flickering Light? 6 Answers

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

shader for light replacement blending, instead of additive blending? 0 Answers

[ShaderGraph] How can I prevent lights overlapping in intensity? 0 Answers

How do I keep an object lit when a light moves past it? 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