---
tags:
    - "Environment"
    - "Fog"
    - "Mist"
    - "Haze"
    - "Atmosphere"
---

# Set Render Settings Fog Mode

[Rendering](../index.md) / [Render Settings](index.md) / **Set Render Settings Fog Mode**

## Description

Changes how the scene fog grows with the distance to the camera

## Parameters

| Name | Description |
| :--- | :---------- |
| Fog Mode | Linear fades between the start and end distances. Exponential and Exponential Squared use the density |

## Code

```cs
using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Title("Set Render Settings Fog Mode")]
    [Category("Rendering/Render Settings/Fog Mode")]
    [Description("Changes how the scene fog grows with the distance to the camera")]

    [Image(typeof(IconPicture), ColorTheme.Type.TextLight, typeof(BadgeSettings))]
    [Keywords("Environment", "Fog", "Mist", "Haze", "Atmosphere")]

    [Parameter("Fog Mode", "Linear fades between the start and end distances. Exponential and Exponential Squared use the density")]

    [Serializable]
    public class InstructionRenderSettingsSetFogMode : Instruction
    {
        [SerializeField] private FogMode m_FogMode = FogMode.ExponentialSquared;

        protected override string GetTitle(GameObject source)
        {
            string className = TextUtils.ThemeAsKeyword("Render Settings");
            string member = TextUtils.ThemeAsKeyword("Fog Mode");
            return $"{className} {member} = {this.m_FogMode}";
        }

        protected override Awaitable Run(Args args)
        {
            RenderSettings.fogMode = this.m_FogMode;
            return Done;
        }
    }
}
```

