- Home /
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
After Toggle
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.
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?
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.
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.
@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
Follow this Question
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