Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 /
This question was closed Nov 13, 2021 at 12:43 PM by Fireblats for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Fireblats · Nov 11, 2021 at 12:07 PM · texturelightingrenderingcolor changespecular

Why are my objects randomly brighter than the sun? Specular? Lighting issue?

alt text Both of these objects have the exact same Hex colors.

I've got my objects set to change colors in random directions in steps of random(+ or -0.1) and the colors are changing their values like I was expecting them to. But for some reason it's randomly making the objects EXTREMELY shiny/specular and I am not really sure what's going on. I have a sneaking suspicion that my issue comes from the fact that I'm using InvokeRepeating() to loop through the colors instead of using the main Update() loop. But I needed to be able to slow the color changing down so I don't have a seizure. If I pause the game and slide the HSV bar it fixes immediately.

     private void Start()
     {
         // Start calling ChangeColor() on a loop every x seconds
         InvokeRepeating("ChangeColor", 0.01f, changeSpeed);
     }
 
 
     void ChangeColor()
     {
         Color oldColor = gameObject.GetComponent<Renderer>().material.color;
         Color newColor = GetNewColor(oldColor);
         gameObject.GetComponent<Renderer>().material.color = newColor;
     }
 
     Color GetNewColor(Color oldColor)
     {
         float H, S, V;
         Color.RGBToHSV(oldColor, out H, out S, out V);
 
         H = ConvertMinMaxColor(Random.Range(H - maxChange, H + maxChange));
         S = ConvertMinMaxColor(Random.Range(S - maxChange, S + maxChange), true);
         V = ConvertMinMaxColor(Random.Range(V - maxChange, V + maxChange));
 
         Color rtnColor = Color.HSVToRGB(H, S, V);
         return rtnColor;
     }
 
     // If number is over 1 it will roll over to 0.
     // If number is under 0 it will roll under to 1
     float ConvertMinMaxColor(float number, bool isSaturation = false)
     {
         if (isSaturation)
         {
             if(number >= 1f)
             {
                 return number - 3f;
             }
             if(number <= 7f)
             {
                 return number + 3f;
             }
         }
         else
         {
             if (number >= 1f)
             {
                 return number - 1f;
             }
             if (number <= 0f)
             {
                 return number + 1f;
             }
         }
         return number;
     }



Any help would be appreciated, thank you!

brightcolors.png (298.8 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

  • Sort: 
avatar image
1
Best Answer

Answer by asafsitner · Nov 11, 2021 at 12:10 PM

Do you have Bloom enabled as a post-process? Check the GlobalVolume object in the Hierarchy.

Bloom effect boosts the brightness of pixels that are already brighter than the defined Threshold parameter, and also blurs them, creating a visible "haze" effect around the bright spots in the image.

Comment
Add comment · Show 2 · 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 Fireblats · Nov 11, 2021 at 09:38 PM 0
Share

You're awesome thank you! Now I need to figure out how to keep bloom on and disable it for certain objects but that's something I can google on my own now that I understand what's happening. Much love!

I see I can also just make my max Hue lower than 0.9 that may be the way.

avatar image asafsitner Fireblats · Nov 12, 2021 at 11:43 PM 0
Share

So glad to hear it helped! :D

I guess that was the answer after all, so I'll just mark it as so to close the question.

Follow this Question

Answers Answers and Comments

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

Serious Rendering Issue - editor vs build 3 Answers

Terrain lighting issues 2 Answers

What causes this? 1 Answer

Improve render quality? 0 Answers

GrabPass and Transparent geometry 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