Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 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 /
  • Help Room /
avatar image
0
Question by christopf · Dec 16, 2016 at 08:29 PM · lightningambient lightrendersettings

Is RenderSettings.ambientIntensity changeable through a script?

Hi, i would like to change the ambientIntensity value ingame dynamically. Code-wise it is working and you can see the controller changing while the game is running. But it doesn't effect the scene like when i start the game with different values for ambientIntensity.

The docs are saying:

Note that render settings are per-scene.

https://docs.unity3d.com/ScriptReference/RenderSettings.html

Does that mean it isn't possible to change dynamically?

----------------------

//Edit 1
Someone pointed out that the "per-scene" quote means that settings won't be transfered to the next scene. Additionally i found out that RenderSettings.ambientIntensity has a get and a set accessor. If you change Ambient Source to Gradient or Color it seems to be dynamically adjustable.

----------------------

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 SoraMahiro · Dec 16, 2016 at 08:42 PM 0
Share

Also in addition to my answer, there is a Baking . This, to my knowledge, happens at the beginning of the scene. This is probably what they are referring to by pre-scene. It would be possible to load the same scene with the new ambient lighting during the playback of the current scene.

avatar image christopf SoraMahiro · Dec 19, 2016 at 10:07 AM 0
Share

I have no baking activated in my game. It's all realtime since there are no non-moving objects.

3 Replies

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

Answer by mikelortega · Jan 02, 2017 at 10:01 AM

I think RenderSettings.ambientIntensity doesn't work in Unity 5.5 and should be marked as deprecated. It worked in Unity 5.4 and previous versions. I guess you should use RenderSettings.ambientSkyColor.

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
avatar image
0

Answer by SoraMahiro · Dec 16, 2016 at 08:33 PM

It is under a static category, meaning that it is determined and unchangeable. So, as for your question, yes. It is not possible to change it dynamically. However, it does belong to a class and type, so it may not be as impossible as it seems. I would look into how to deal with static members in the microsoft documents.

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 christopf · Dec 19, 2016 at 10:05 AM 0
Share

I'm not so sure, but to have a static being unchangeable it must be tagged as const or only have a get accessor (and no set). But the ambientIntensity variable has a get and a set accessor which suggests they should be changeable.

avatar image
0

Answer by Jelli35 · Nov 23, 2020 at 12:14 PM

Yes, but you need to call DynamicGI.UpdateEnvironment(); for it to update during playmode ,Yes, but you have to call DynamicGI.UpdateEnvironment(); afterwards for it to update during playmode https://docs.unity3d.com/ScriptReference/RenderSettings-skybox.html

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

85 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

Related Questions

Networking and RenderSettings (ambientLight) 0 Answers

RenderSettings.ambientLight change not working! C# Scripting. 1 Answer

Ambient Intensity doesn't work in my scene - Help please! 0 Answers

Why are all my models white in HDRP? 1 Answer

Help with lightning through probuilder plane 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