9.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.
An additional directional light scattering color can be enabled.

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.

Stylized Water 3 (v3.3.3+) has an automatic integration for SC Screen Effects.
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 Screen Effects\Runtime\Fog\Fog.hlsl shader library and use the
ApplyTransparentFogfunction. You can find an example shader in the Fog/Integration folder. - In Shader Graph you can use the
Apply Screen Space Fogsub-graph. In the Packages\SC Screen Effects\Runtime\Fog\ShaderGraph folder, you’ll find an shader that illustrates how this can be achieved.

(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 Screen Effects\Runtime\Fog\Fog.hlsl file)
Refractive materials
Materials using a shader that uses the Scene Color node in Shader Graph, or the SampleSceneColor() function in HLSL use URP’s Opaque Texture.
This texture represents the screen color as it appears right after opaque materials have rendered, but before transparent materials do.
The Fog effect (by default) renders after transparent materials, so is never captured in the Opaque Texture.

What you’ll then see happen is that a Refraction effect shows the scene unfogged. Because the Opaque Texture is a capture of the scene before Fog is rendered onto the screen.

The solution here is to enable the Copy To Opaque Texture option on the render feature.
This will apply the Fog to the Opaque Texture, making it visible in any shader that uses it.
Post Processing Volume Component. See Setup.In Stylized Water 3, this will also make the Fog visible in Screen Space Reflections rendering!
