• 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 seemingly 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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



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

[SOLVED] In which GI lighting modes are different light probes/maps used? 1 Answer

Disable Ambient Light for some GameObjects 1 Answer

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

Ambient Intensity not working 2 Answers

skybox as ambient source unity 4 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges