Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Carkey · Mar 10, 2015 at 02:37 AM · lightingunity5skyboxambient lightambient

Unity5: Changing AmbientSkyColor doesn't change Skybox Color

Hello,

I am playing around with a new game mechanic but I've hit a simple problem with Unity 5.

I want to be able to make the scene very dark at certain points in the game. I reduce my lights' intensity property and I also change RenderSettings.ambientSkyColor to go towards black (0, 0, 0). This has a really nice effect except that the Skybox stays the same brightness throughout, meaning my models look like silhouettes against the skybox. What I'd like is for the skybox to darken also but I can't seem to find any way to do this. Can anyone help?

(In case anyone suggests: No I do not just want a black GUI plane infront of the camera that fades alpha because the player should still be able to slightly see the game objects).

Thank you for your time.

EDIT

I've also had a go at changing the ambientGroundColor and ambientEquatorColor in case these made any difference but they didn't seem to.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Cherno · Mar 10, 2015 at 02:43 AM

You can change the skybox' tint color:

 RenderSettings.skybox.SetColor("_Tint", Color.black)

Be aware that any changes made during runtime will persist after the game stops running, so you need to call the OnApplicationQuit function and reset it if you don't want that.

 void OnApplicationQuit() {
         RenderSettings.skybox.SetColor("_Tint", defaultSkyTineColor);
         RenderSettings.ambientLight = defaultAmbientLightColor;
     }
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 Carkey · Mar 10, 2015 at 05:43 PM 0
Share

Hi,

Thank you for your quick response but I'm getting an error saying "_Tint" doesn't exist as a color property for $$anonymous$$aterial. Could it be that I'm using Unity 5? (Because I did see that some other mentions to skybox's "_Tint" property.

I found this page on the docs: http://docs.unity3d.com/ScriptReference/$$anonymous$$aterial.GetColor.html which says that there are the following properties:

  • "_Color"

  • "_SpecColor"

  • "_Emission"

  • "_ReflectColor"

But I've just tried "_Color" and I'm getting the same error saying the material doesn't have such a color property.

Any ideas?

avatar image Carkey · Mar 10, 2015 at 05:59 PM 0
Share

Hmm, even more interestingly, calling:

 RenderSettings.skybox.color;

gives the error:

$$anonymous$$aterial doesn't have a color property "_Color" - UnityEngine.$$anonymous$$aterial:get_color()

So a see$$anonymous$$gly public property "color" calls .getColor("_Color"); underneath which apparently doesn't exist.

$$anonymous$$aybe I shouldn't have moved to Unity5 so quickly!

Any ideas?

avatar image
0

Answer by samoO · Jun 16, 2015 at 05:43 PM

Hey, I know I am a bit late but I had a similar problem and after some try and error fun I found this solution:

To change the "Ground" color you can use:

 RenderSettings.skybox.SetColor("_GroundColor", color);

To make your whole skybox darker you can use Exposure:

 RenderSettings.skybox.SetFloat("_Exposure", val);

Be aware of the fact that this will change your Skybox Material even after you quit Play Mode. I haven't found out yet how to change the Sky Tint though, sorry about that...

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

23 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

Related Questions

RenderSettings.ambientProbe "empty", how to access? 0 Answers

skybox as ambient source unity 4 1 Answer

Need help with 24 Hour timing script. 1 Answer

Enviroment Lighting from Sky not updating in realtime 0 Answers

Toggling Ambient Light intensity 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