RenderSettings.fog no longer working on PreRender and PostRender

Using Unity 2019.4.9 LTS, I believe this happened after updating URP from 7.3.1 to 7.5.1. I have a script for disabling fog on selected cameras, pretty much identical to this one in the docs. It just doesn’t work anymore, I still see the fog in the Camera where I attach the script to.

EDIT: looks like this only happens in the editor because my Android/Quest build is fine. This is probably part of this same issue , where I can’t see URP MSAA anymore but only when playing in the editor. Something is happening to the editor URP camera I suppose.

The best workaround I would recommend (that works in both) is using RenderPipelineManager.beginCameraRendering and endCameraRendering callbacks. Simply compare the camera value from the argument to the camera you wish to modify and toggle its fog state. My game has 2 different fog values that are used and I am using 7.4.3 URP.

1 Like

Thanks, that worked for the fog!