Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Sep 18, 2016 at 12:09 PM by $$anonymous$$ for the following reason:

Decided to do something else.

avatar image
0
Question by $$anonymous$$ · Sep 15, 2016 at 10:00 PM · c#particlesfog

How do I call the Global Fog script from StandardAssets/Effects/ImageEffects?

Hi.

Is there a way to call the Global Fog script from UnityStandardAssets to be accessible in my DayNight script? I'm trying to get the nights to appear darker at nighttime and then disable it again when it's daytime.

Comment
Add comment · Show 1
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 Namey5 · Sep 16, 2016 at 05:51 AM 0
Share

Surely you would assign it, then enable it/disable it as in any other script.

1 Reply

  • Sort: 
avatar image
0

Answer by AurimasBlazulionis · Sep 16, 2016 at 07:14 AM

Fog can be toggled using RenderSettings.fog. It is a boolean.

Comment
Add comment · Show 5 · 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 $$anonymous$$ · Sep 16, 2016 at 04:05 PM 0
Share

Thank you. There seem to be a bug with that "using" cause a few days ago there wasn't anything that listed "ImageEffects" in $$anonymous$$onoDevelop..

How do I get the GlobalFog exposed in the inspector so I can apply it to the script or is that not needed?

I added using UnityStandardAssets.ImageEffects; and then a variable public ImageEffects globalFog;, but didn't seem to work to be able to use the GlobalFog script.

avatar image AurimasBlazulionis $$anonymous$$ · Sep 16, 2016 at 04:27 PM 0
Share

It seems global fog is not toggleable, but you can disable fog using RenderSettings.fog value,

avatar image $$anonymous$$ AurimasBlazulionis · Sep 16, 2016 at 07:07 PM 0
Share

Good idea. Although, I have an issue with RenderSettings.

The RenderSettings.fogDensity works on daytime but won't update when the night comes.

They are both in an if statement in the Update() function like this:

 if (hour >= 180) {
             // It's nighttime
             time = nightTimeLength;
             sun.color = nightTimeColour.Evaluate (time);
             RenderSettings.fogDensity = 0.2f;
             sun.intensity -= Time.deltaTime;
         }
 
         if (hour <= 180) {
             // It's daytime
             time = dayTimeLength;
             sun.color = dayTimeColour.Evaluate (time);
             RenderSettings.fogDensity = 0.01f;
             sun.intensity += Time.deltaTime;
         }

How can I make the RenderSettings update itself?

Show more comments
Show more comments

Follow this Question

Answers Answers and Comments

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

Multiple Cars not working 1 Answer

Rain particles are getting affected by the fog 2 Answers

Distribute terrain in zones 3 Answers

Initialising List array for use in a custom Editor 1 Answer

What is the best way to assign a duration to particles? 1 Answer


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