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 harpoaian · Jul 19, 2018 at 03:46 PM · lightingpost processingemissive

Post Processing Stack making bloom brighter when light is toggled

Good Morning everyone,

My team and I have been having issues with the post processing stack asset in regards to the bloom effect. In one of our levels we have a switch and when the switch is toggled it is supposed to toggle the lights on and off it does this perfectly. BUT for some strange reason the bloom on the lights gets super bright. Now when I have the post processing script turned off this issue doesn't happen so I know it is linked with it. Here is a picture of what I am talking about Before Toggle alt text

After Toggle alt text

And here is the code that controls the lights when they are toggled

 using UnityEngine;
 using System.Collections;
 
 public class L7TubeLights : MonoBehaviour {
         
     public bool TestButton = true;
 
     public bool invertPowerFunction = false;
 
     private bool fireOnceCheck = false;
     public Renderer[] lightList;
 
     public GameObject electricObject;
 
     private Color whiteGreen;
 
     // Use this for initialization
     void Start () {
         
     }
     
     // Update is called once per frame
     void Update () {
                 
         TurnLightsDown();
         TurnLightsUp();
 
     }
     
     void TurnLightsDown () {
         //Old code for testing: TestButton == false && fireOnceCheck == false
         if (electricObject.GetComponent<ElectricObject>().hasEnergy == false && fireOnceCheck == false)
         {
             if (invertPowerFunction == false) 
             {
                 foreach (Renderer lightRenderers in lightList) 
                 {
                     lightRenderers.material.color = Color.black;
                     lightRenderers.material.SetColor ("_EmissionColor", Color.black);
                     DynamicGI.SetEmissive (lightRenderers, Color.black);
                     RendererExtensions.UpdateGIMaterials (lightRenderers);
                     Debug.Log("Turning lights down.");
                     fireOnceCheck = true;
                 }
             } 
             /*else 
             {
                 foreach (Renderer lightRenderers in lightList) 
                 {
                     lightRenderers.material.color = Color.white;
                     lightRenderers.material.SetColor ("_EmissionColor", Color.white * 5);
                     DynamicGI.SetEmissive (lightRenderers, Color.white * 5);
                     DynamicGI.UpdateMaterials (lightRenderers);
                     //Debug.Log("Turning lights up.");
                     fireOnceCheck = true;
                 }
             }*/
         }
     }
 
     void TurnLightsUp () {
         //Old code for testing: TestButton == true && fireOnceCheck == true
         if (electricObject.GetComponent<ElectricObject>().hasEnergy == true && fireOnceCheck == true)
         {
             if (invertPowerFunction == false) 
             {
                 foreach (Renderer lightRenderers in lightList) 
                 {
                     lightRenderers.material.color = Color.white;
                     lightRenderers.material.SetColor ("_EmissionColor", Color.white * 5);
                     DynamicGI.SetEmissive (lightRenderers, Color.white * 5);
                     RendererExtensions.UpdateGIMaterials (lightRenderers);
                     Debug.Log("Turning lights up.");
                     fireOnceCheck = false;
                     Debug.Log("Hopefully this doesn't come up multiple times because if it does then the issue is here!!");
                 }
             } 
             /*else 
             {
                 foreach (Renderer lightRenderers in lightList) 
                 {
                     lightRenderers.material.color = Color.black;
                     lightRenderers.material.SetColor ("_EmissionColor", Color.black);
                     DynamicGI.SetEmissive (lightRenderers, Color.black);
                     DynamicGI.UpdateMaterials (lightRenderers);
                     //Debug.Log("Turning lights down.");
                     fireOnceCheck = false;
                 }
             }*/
         }
     }
 }

So my question is how do I fix this issue? This is a huge issue for our playtesters because the light can get super bright and it hurts the players eye's.

beforetoggle.png (198.7 kB)
aftertoggle.png (160.5 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 Bunny83 · Jul 19, 2018 at 04:01 PM 0
Share

Uhm, maybe i miss something but that's what bloom is all about. $$anonymous$$aybe you want to tweak the settings of the bloom effect?

avatar image harpoaian Bunny83 · Jul 19, 2018 at 06:36 PM 0
Share

Yes we have tried messing with the settings but doing that effects the bloom everywhere else. Plus when the switch is toggled the bloom just keeps getting brighter and brighter. $$anonymous$$y comp is very old so you can't really tell but on my $$anonymous$$mmates comps its super bright.

1 Reply

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

Answer by villevli · Jul 19, 2018 at 10:31 PM

At line 70 in the code you posted you are setting the emission color of the lights. Decreasing the value from 5 would likely reduce the bloom effect.

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 harpoaian · Jul 20, 2018 at 01:29 PM 0
Share

@villevli post what you posted as a comment so I can mark it as the correct answer and give you points! That was it thank you very much!! I changed the 5 in both line 70 and 71 to a 2 and it works perfectly. It's the simple things that always elude me all the points to you!

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

115 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

Related Questions

Realtime emission material during runtime 0 Answers

How to make emissive material which responds to Sprite Renderer color? -1 Answers

LWRP Lightmapping issue in 2019.1.11f1 when using emissive materials 0 Answers

Ambient occlusion stops at certain camera angles/positions 1 Answer

Getting an extremely bright object (the sun) visible from an extreme distance? 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