SC Screen Effects Documentation (v3)

Pending release

Documentation is a work in progress draft!

SC Screen Effects
Version: 3.0.0
Review

8.1.Fog #

Adds distance and height-based fog to the scene. Features several color modes:

Uniform color
Fog will be a single color

Gradient
Samples a horizontal gradient texture from left (near) to right (far). Will expose a distance parameter to control the length of the gradient.

Skybox color
Fog will take on the color of the skybox, making it seamlessly blend in.

Transparent materials

The effect relies on the depth texture Unity renders, which provides a means to measure the distance from the camera to an object’s pixel on screen. Based on this distance, a certain amount of fog is applied.

As such, shaders that don’t support depth writing will not be affected by fog. This usually means:

  • Transparent materials (water/particles/etc).
  • Sprites.
  • UI elements
  • Custom shaders without a DepthOnly pass.

On these materials, no amount of fog gets applied, which makes them stand out unwantingly.

The Stylized Water 3 asset has a native integration for this effect, and will have fog applied to the water correctly.

Solution

The only way around this is to incorporate the fog shading into custom a shader for the above purposes, and using that instead. Instead of using the external Depth texture, fog can be applied based on the surface’s distance to the camera instead. This is exactly how Unity’s standard fog works, which applies fog directly to an object, rather than through post-processing effect. This is also far more efficient!

  • For hand-written shaders, you can include the Packages\SC Post Effects\Runtime\Fog\Fog.hlsl shader library and use the ApplyTransparentFog function. You can find an example shader here.
  • In Shader Graph you can use the Apply Screen Space Fog sub-graph. In the Packages\SC Post Effects\Runtime\Fog\ShaderGraph folder, you’ll find an shader that illustrates how this can be achieved.

On the fog render feature the “Skip Transparents” option must be enabled when incorporating this (default setting).

(An alternative is to modify Unity’s/URP’s shader libraries, and replace the function that applies fog. This won’t be covered in further detail. Experienced graphics programmers can reference the Packages\SC Post Effects\Runtime\Fog\Fog.hlsl file)

Yes No Suggest edit
Last updated on September 25, 2026
0 of 0 users found this section helpful
If you're familiar with this asset, please consider leaving a review!
Your support is what makes complementary updates possible!
Suggest Edit