Material function not working on MOBILE

I created a material function to fade materials to black if the player is far away from them. I am making a horror game, so his view distance must be limited and dark.

252430-matfunc.png

The material fades to black when far away on PC, but it stays orange when launching on my mobile phone (s9 plus). I have a feeling it has something to do with the absoluteworldposition and/or camera position, but I am not sure.

Waiting for some input…thanks

bump…bump

Materials that you use for mobile do not have all functions like materials for a pc game.

Did you already read this: Materials for Mobile Platforms | Unreal Engine Documentation

Maybe this video can help u 2: Depth & Location Based Effects | Live Training | Unreal Engine - YouTube

I really hope this solves your problem.

So, my conclusion (correct me if I am wrong) is that I need to enable full precision for mobile on the texture. However, if I do that, it won’t be supported on a lot of devices, and this effect is absolutely critical for me game. So I will have to use something else to get this effect.

The only alternative I can think of is height fog, but it doesn’t give me the effect I am looking for.