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 /
  • Help Room /
avatar image
1
Question by GamesByCono · Feb 10, 2017 at 10:10 PM · shaderobjectstaticpoint light

Point Light causing flickering on Static object

I have an issue i'm trying to resolve regarding a specific "Forward" Shader on an object i'm using and a point light that is next to it, when i move around in Game mode the lighting on the object flickers as seen here

https://gyazo.com/7ec69ec0ce02399e9eafa1a198382ea6

In the image, the gas station object and sub objects are marked as static as they never ever move, however, when I add a point light to it, baked, realtime, doesn't matter, the light flickers on the textures as i move around. I've tried modifying EVERY setting I can think of and some other advice i've looked at for similar issues (changing pixel count up to 10, etc). IF i change the shader on the object, it works fine, but i lose the shader effect i'm going for. (the shader in question is MK4/Forward/MK4_Building_Toon - these are shaders that came with the asset package i'm using. If i change the shader to the standard MK4_Building_Toon the light works properly and i dont receive any flickering, however i lose the effect of the standard shader (the toon type outline). Also if i change the object to not be static with the original shader the problem ceases as well.

Is there anything i'm doing wrong regarding lighting? Is this a shader issue perhaps? I'm very new to unity and optimizing lighting in general, and i'm not sure what i'm doing wrong here.

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

3 Replies

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

Answer by GamesByCono · Feb 12, 2017 at 03:51 AM

EDITED:

So the only way to solve this, to use my "Forward" based shaders and forward rendering is to turn off Static Batching in the Player Settings. This then allowed the static objects to not flicker anymore with a single point light, or multiple. I'm not sure if this is a bug or what but as of unity 5.5 (and 5.6beta) this is the only solution that worked that didn't have me completely changing the shader to a different one or turning the objects off static.

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
avatar image
0

Answer by FortisVenaliter · Feb 10, 2017 at 10:48 PM

In forward rendering, the number of lights that can affect a single object is heavily limited. So, if you have more than a few lights, unity will try to choose the best ones to apply at any given time. When you move around and it appears to flicker, you are seeing that decision change.

There are a few ways to correct this. Deferred shading can handle many more lights. Breaking down your meshes into separate components allows Unity to choose lights for each component, which tends to make it more consistent. Or, if the light is really important, you can set it as important in the light settings, but if you do so for all lights, you'll have the same problem.

Look into the information on the different rendering paths of Unity for more information on why it behaves this way.

Comment
Add comment · Show 3 · 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 GamesByCono · Feb 11, 2017 at 12:59 PM 0
Share

Thank you for the response!

Unfortunately none of this solves the issue. I only have this SINGLE point light in my scene, I have a directional light as well of course. I guess i'm not understanding why when i change the shader it works, or when i set the object as not static it works.

I've tried going into Project Settings -> Graphics and unchecking the Use Defaults on each of the Tiers (1,2,3) and setting their rendering path to Deffered and this still occurs. I've tried setting the light to Important.

The only way to solve the issue is to change the shader or to change the object to non static with the forward based shader.

avatar image GamesByCono · Feb 12, 2017 at 03:19 AM 0
Share

I'm still at a loss here, nothing i do beside the two mentioned methods fixes the issue with the blinking light issue in the gif. Is this just simply a shader problem? And if so, what could/would be the cause of it. It's hard to understand all the intricacies of the lighting system and limitations when i'm unable to resolve a simple lighting issue :( I've banged my head on this for 2 whole days lol Hoping to find an AHAH moment soon though!

avatar image Alejandro-Martinez-Chacin · May 29, 2019 at 11:32 AM 0
Share

This still happens on recent versions of Unity by the way. And sometimes is just not possible to switch to deferred compatible shader (like when doing transparent lit stuff or screen grab pass effects). $$anonymous$$y take is that a batched object loses the individual pivots of the pre-batched ones and has to use a single one for deter$$anonymous$$ing which light to use. Did you ever find a solution?

avatar image
0

Answer by cmx · Dec 13, 2017 at 12:05 PM

Hi, I'm having the exact same issue in 5.6.1p1. Anyone have a solution for it? It seems to happen if you use custom lighting in your shader, with batching on. thanks, Mike

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

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

Why is this point light square? 1 Answer

How do I reset a static gameObject? 1 Answer

Point/Spot lights only emit half of the light on my terrain 6 Answers

In-game 3D objects appear lit, although they have dark material on them 0 Answers

How to get the bone transform matrix in the vertex shader? 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