thanks for sharing the code.
instead of using an If you could use a step or smooth step. since you’re only thresholding. and could be faster than an if. and simpler.
also i personally recommend using a different arithmetic. there’s something like an offset and division that gives you a fade instead of a hard cut.
the smoothstep will give you a small fade.
you can do something like
((AWP - CamPos) + Offset )/ Distance > saturate or smooth step
this guy uses that patter a ton, i think he uses it in the video. check it out (it for a different thing but at some point he usses that patterns and explains it (i think, iirc)) https://www.youtube.com/watch?v=-ynkbsCT2Ic
i’m not sure.
there’s a fog that it’s a simple fog based on distance. you’ll have to do some research. it might help.
i think it should work on vr because it’s a trivial fog, but i cant remember if ue exposes it directly.
also check my alternative solution about configuring the stage for the post process and the particles materials.
that’s only for post process i think.
OOOOOotherwise i just thought of a random approach you can use that might work (please check the postprocess first)
You can set the cull distance to a lower value, then make all materials have a DistanceCullFade or PerInstanceFadeamount to drive a fade out.
and have a solid black bg where things fade into.
also use a cull distance volume.
also i’d recomend on the material to use Opaque/Masked and drive the opacity (mask) through a ditherTemporalAA.
making your materials translucents will make your game much less performant on VR. and also will not write to depth buffer.
it’s a round about way but might work. the problem is that those nodes i think are per mesh, not per vertex. so it will fade kinda like that sonic in saturn (iirc).