Simple Fog Effects For URP

April 19, 2026 ยท View on GitHub

This project will provide some URP-based fog effects, and implement it in a relatively quick way.

Requirements

  • URP v17

Unity 6 Compatibility Note

Unity 6000.4 removed the URP Compatibility Mode option. This package keeps the old non-RenderGraph path only for Unity versions below 6000.4, and uses the RenderGraph path on 6000.4+.

  • Unity 6000.0 to 6000.3: RenderGraph and Compatibility Mode are both supported.
  • Unity 6000.4+: only the RenderGraph path is used.

For URP v14~16, check urp14 branch

Installation

  • Install via UPM git URL

    https://github.com/meryuhi/URPFog.git?path=Packages/Fog

  • Install via Packages/manifest.json

    "moe.meryuhi.effects.fog": "https://github.com/meryuhi/URPFog.git?path=Packages/Fog"

Full Screen Fog

It based on Volume framework and URP Renderer Feature. Also the FullScreenFog shader itself is also a Fullscreen Shader Graph, so it can be used in Full Screen Pass Renderer Feature.

Because it is based on Volume framework, you can smoothly switch different effects between different areas without coding.

Screen Shoots

Depth Mode

Depth Mode

Distance Mode

Distance Mode

Height Mode

Height Mode

With Transparent Objects (Experimental)

This requires setting up a Camera Stack. Please refer to the instructions.

With Transparent Objects

With Noise

https://user-images.githubusercontent.com/23119289/233851479-d5f80709-403a-4a09-9b70-240634c55bcb.mp4

Instructions

  1. Add a Full Screen Fog Renderer Feature into your URP renderer.

    NameDescription
    Injection PointSelection for when the effect is rendered. Before Rendering Skybox: Using this if you do not want to override skybox.
    Render CameraSelection for which camera type want to render.
    ShaderAutomatically set FullScreenFog shader provided by the package, or you can create your own (you need to check parameter design).
  2. Add a Meryuhi/Full Screen Fog override into any local or global Volume, just like with other post-processing effects. Turn Fog -> Color settings on and adjust the alpha, and then you can see the effect.

    By default it set to be similar to Unity built-in fog, but you can configure it.

    NameModeDescription
    ModeDepthDirectly use the depth value calculation, which is consistent with Unity.
    DistanceUsing distance for calculation, the calculation will be more complex, but it looks better.
    HeightUse the height in Y asix for calculation.
    Color-Fog color.
    Density ModeLinear
    Exponential
    ExponentialSquared
    Start Line-Start depth or distance.
    End Line-End depth or distance.
    Start Height-Start height.
    End Height-End height.
    Noise
    Noise ModeOffDisable.
    ProceduralProcedurally generated noise effects, possibly expensive.
    TextureUse a custom noise texture.
    Noise Texture-Texture used by the noise.
    Noise Intensity-Mixing strength of the noise.
    Noise Scale-Scaling of the noise.
    Noise Speed-Scrolling speed of the noise.
  3. (Optional step for transparent objects)

    Experimental support. The approximate effect is produced by rendering fog and transparent objects twice, which is not completely correct.

    1. Add a StandardFullScreenFogOverlayRenderer or your own renderer into your URP pipeline asset.
    2. Set up a Overlay camera on your Main Camera.
    3. Switch Renderer property to StandardFullScreenFogOverlayRenderer on the Overlay camera.

Performance

Use Rendering Debugger to evaluate time. Use the development build to run the SampleScene in the project at 2560*1440 resolution with Radeon RX 580.

ModeDensity ModeNoiseTime(ms)
DepthLinearOff~0.6
DepthExponentialOff~0.6
DistanceLinearOff~0.6
HeightExponentialSquaredOff~0.6
HeightExponentialSquaredProcedural~0.8

This is a rough and not very accurate test, but you can know something about the approximate performance consumption.

Known issues

  • In the case of using noise, if the Noise Scale is too large, the result may not be very good.

Todo

  • Volume Fog

References

License

This project is under the MIT License.