Fog simulation with PolySpatial framework and ShaderGraph

Hello,

I would like to create a basic fog synthesis / simulation on AVP with Unity PolySpatial. In order to quickly process and not re-invent the wheel; I would like to get opinions.

What would be the most feasible way to do it regarding the compatibilty of shaders being used. The type of fog I am interested in is basically smearing / blurring some objects in distance.

If there is an asset you can suggest which works well on VisionOS, this is welcome as well.

I appreciate your help, thanks in advance.

1 Like

Do you want to smear/blur rendered objects, real-world objects, or both? I don’t think there’s any great way to blur real world objects aside from the (very limited) PolySpatial Background Blur shader graph node (which just maps directly to Apple’s Blurred Background). That provides an extreme blur: the equivalent of what Apple uses for its frosted glass effect on UI.

Notably, there’s no way to access the passthrough texture to blur it in either the VR/Metal or MR/RealityKit modes.

Thank you . That sounds interesting.
I want to blur rendered objects , in order to give the atmospheric effect that they in distance. ( up to 1km ) Otherwise it seems to me like they are scaled down but still close.

To blur rendered objects, it depends on whether you’re using VR/Metal mode or MR/RealityKit/PolySpatial. With the former, AFAIK, you should be able to use any standard shader that processes the color buffer. With the latter, things are more complicated. Technically, you can render the objects in Unity to a RenderTexture (or pair of them: one for each eye) and perform the blur on that, then render it in front of the user. That will only work in unbounded mode, since that’s the only case where you can get the user’s device (head) position in order to know what to render. And you don’t have access to the device’s actual field of view or IPD, so you have to estimate some parameters. There are some other threads on this approach, such as the one here.

Thank you for those valuable informations.

1 Like