[HELP] How to use fog in Universal RP?

Hello, i upgrated built-in render pipeline to Universal RP, when i was using built-in RP fog worked fine, i used fade rendering type:

Now fog don’t hide objects:

How can i solve this problem? Please help.

What shader is the ground using? It looks like this is not recieving fog but the other blocks are.

5571697--574936--upload_2020-3-10_14-29-50.png

Should i use global fog?
5571706--574945--upload_2020-3-10_14-32-52.png

and thats the only material in the scene? do you have any lights in the scene and if so, does the fog work better if it is turned off?

Nope, I’m actually puzzled by the fact that you are seeing this, as you should be using URP and it has no deferred rendering.

1 Like

i used deffered fog in post processing stack before
5571790--574960--upload_2020-3-10_14-49-38.png

i have directional light in scene

blocks have almost the same material but different color

5571802--574963--upload_2020-3-10_14-56-0.png

Ah ok, so Deferred fog will no longer work as we do not have a deferred renderer in URP, you will have to use the normal fog settings in the lighting settings window.

5571952--574987--upload_2020-3-10_14-27-34.png

1 Like

5572000--574999--upload_2020-3-10_15-42-11.png

Now fog cover all objects
5572000--575002--upload_2020-3-10_15-43-37.png

Try lowering the density, also you can try the different 'Mode’s to get the same look as before.

5572078--575017--upload_2020-3-10_15-52-6.png

5572078--575032--upload_2020-3-10_15-57-22.png

i lowered density and tried different modes but it all the same, only linear mode don’t cover ground but still don’t hide blocks and i still see this message, maybe it’s a bug or something.

I would try make the colour the same as your skybox, and then switch to linear fog, at that point playing with the near and far to get it the same distance it was. The message you are seeing is a UI issue, where it believes you are still using builtin renderer and not Universal RP, but this will not affect the fog.

If you remember the settings you used on teh deferred fog that would be easiest to move them over as they should work the same.

5572285--575059--upload_2020-3-10_16-31-51.png

done, but fog still don’t hide blocks just cover them

that how it was when i used standard RP

I’ve solved this problem, my ground was a cube… when i change it to a plane all works fine now. thats was so simple, i feel awkward a little bit :slight_smile:

1 Like

Quick question how do I adjust the distance of the fog. I need a very long line of sight

you can change density value of the fog

1 Like

I’m pretty sure this is because (exponential) fog in URP is calculated per vertex instead of per pixel. I’m not sure if this is an oversight or on purpose for performance reasons (this is URP after all). So if you want more correct (exponential) fog on large objects using the built-in fog functionality, you will need to give them (a lot) more vertices.

2 Likes

Hey bro, I’ve been having the same issue you had when you started this thread. Although I can’t seem to fix mine (even when i make a plane), I might of missed something. I was wondering if you could quickly show me how you fixed it, if you’ve got discord that might be easiest? :slight_smile:

All the best,
R