What is the best setup for rendering realistic scenes in VisonOS MR?

I am creating an RealityKit immersive VisionOS MR scene with realistic lighting effects. Specifically, I want to achieve more accurate lighting for the scene. (unity6000.0.25 PolySpatial2.0.4)
I have a few questions:

  1. Regarding lighting with VisionOSLightSettings: Does the shadow type of the light (e.g., Spot, Direct) not matter as long as the VisionOSLightSettings’ mode is set correctly? In other words, do only Spot or Direct lights produce effective shadows when configured using VisionOSLightSettings?

  2. Use of Reflection Probes: If I plan to use Reflection Probe, is it necessary to convert all materials in the scene to ones created with Shader Graph that include the PolySpatialLightNode? Will this improve the lighting and reflection quality?

  3. Using Lightmaps: What steps do I need to follow for lightmaps to work properly in the VisionOS? Currently, there is a significant difference between the lighting effects in the device and the editor. Do both Realtime Lightmaps and Baked Lightmaps support this setup? If so, are there specific settings or optimizations I should be aware of for each type?

The scene style is similar to this:

Here are some of my current settings (any suggestions for improvements?):

Is it necessary to make all materials use shaders like this? Is the shader I created correct?

RealityKit only supports shadows for spot and directional lights, yes (not for point lights). The shadow type of the light is used to enable/disable shadows (No Shadows → Disabled, Soft Shadows/Hard Shadows → Enabled). RealityKit doesn’t have separate modes for hard and soft shadows. The light types (point, spot, directional) are the same in RealityKit as in Unity.

If I plan to use Reflection Probe, is it necessary to convert all materials in the scene to ones created with Shader Graph that include the PolySpatialLightNode? Will this improve the lighting and reflection quality?

Yes, the only way to use reflection probes is to use the PolySpatial Lighting node. Whether it improves the quality is subjective, and depends on the effect that you’re trying to achieve.

What steps do I need to follow for lightmaps to work properly in the VisionOS?

Lightmaps are supported only through the PolySpatial Lighting node. There’s some documentation of the limitations here. Only baked lightmaps are supported, not realtime lightmaps. Currently, you may find that you need to bake the lightmaps using standard materials and then switch to shader graphs using the PolySpatial Lighitng node; there’s some sample code to do that here. In the next 2.X release, we will be including a different way to include PolySpatial Lighting (via a shader graph “data” extension) that will make this unnecessary and make it so that materials appear correct in the editor outside of play mode.

1 Like

That depends on the effect you want to create. I will point out that, with the support for point/spot/directional lights in RealityKit added for visionOS 2 (and included in PolySpatial 2.X), you don’t need to use the PolySpatial Lighting node to apply dynamic point/spot/directional lights. Instead, you can use the VisionOS Light Settings and any supported lit shader (either a standard shader like URP/Lit or a shader graph with a Lit target). The lighting may not exactly match Unity’s, though, since RealityKit applies its own lighting calculations that we have no control over (versus the PolySpatial Lighting node, which reproduces the calculations used by the URP shaders).

For this shader graph, you’re adding the dynamic lights from the PolySpatial Lighting node to visionOS’s image based lights (and possibly its dynamic lights, if you use VisionOS Light Settings to enable them). Assuming that that’s the effect you want, then the shader graph looks correct.

Edit: Actually, I noticed that you have “Image Based, Dynamic Lights, and Shadows” as the “Default VisionOS Lighting” setting. That means you will be using RealityKit’s point/spot/directional lights and shadows, so you definitely don’t need the PolySpatial Lighting node’s dynamic lights.

Thank you for your response.

So, setting it like this in “player>otherSetting” is correct for VisionOS shadermaps dLDR , right?

Could it be understood that if dynamic lighting and shadows are required, one should enable “Image Based, Dynamic Lights, and Shadows”? And if Lightmap(Only baked) or light probes are needed, the shaders should be switched to those containing “PolySpatial Lighting node”(e.g. the shadergraph in the picture I submitted earlier) before publishing? If both are needed, both steps must be performed?

Does this shadergraph support “Use lightmap in visionOS”+“GameView in Editor”+“SceneView in Editor”+“Generate Lightmap in Editor”? ( I forgot to change BakeLighting and ReflectionProbes in PolySpatialLighting node settings)

Yes, “Low Quality” lightmap encoding uses dLDR.

Yes, that’s correct.

If you’re asking whether you can use that shader graph to bake lighmaps, yes, you should be able to do so (because it uses a Lit target). The MaterialX data extension won’t do anything here (it only applies to Unlit targets).

1 Like

Thank you very much for your multiple responses; they have clarified many of my uncertainties.

1 Like