Is there a way to tweak the fog so it will be mapped on the world Y axis instead of the camear local Z axis ?

Hello dear community !

I want the fog to depend of the world coordinates instead of the camera.

I am building a top down shooter and I want a fog layer on the ground so the base of building will be a bit softer and the character will half disapear.

I suceeded by having the camera exactly at a vertical angle, but I plan to have some camera movement and the angle will change from time to time.
That’s why I ant the fog to be independant of the camera.

I read that you could do something similar by coding shaders, but I can’t do that… ? I believe there are some way to do that with particles but wont it be too heavy for ios ?
Do you know of any solutions other than that?

By the way, I am using this vertex color + lightmap shader :

Thank you for reading!
I hope you can help me with that

Cheers !!!

You can fake it by using a camera shader where the opacity is controlled by the height of the player. You could even fake it by sticking a plane in front of the camera where the opacity is controlled by height. Its not perfect but I have used this technique lots in film making so it is definitely possible to get some reasonable results.

Edit: I found this, which might help. I couldnt tell you if it works on the free version though.

directx - Fog shader camera - Stack Overflow