How to Create a Dim Black Environment with PolySpatial?

Hello everyone,

I’m currently working on a project, and I’d like to create a dim black environment using PolySpatial. My goal is to achieve a dark, subdued ambiance for the entire scene while maintaining some level of visibility for the objects.

I have a few ideas, but I’m not quite sure about the best approach to integrate PolySpatial to achieve this effect. Does anyone have suggestions or examples of Shader/Material configurations to accomplish this?

Thanks in advance for your help!

Yes, I think you have a fair number of options here. If you’re just talking about the rendered objects (versus the real-world scene shown via passthrough), and you’re supporting visionOS 2.0/PolySpatial 2.X, the easiest option might be to simply use the VisionOS Environment Lighting Configuration component to turn down the real-world lighting (say, with a value of 0.1 for the weight). Or, you could disable real-world lighting entirely with that component and use point/spot/directional lights instead, or custom image based lights.

If you want to darken the real-world (passthrough) scenery, that’s a little tricker, but you could probably do it in unbounded mode by rendering an unlit translucent black sphere (with back faces showing) around the user’s head.

Hi, thanks for your reply. Indeed, I want to darken the passthrough, and the solution you mentioned with the sphere is what I did.

I just wanted to make sure there isn’t a proper way to do it, because it can cause a lot of transparency issues. I’m aware of the Vision OS Sorting Group component, but in my case, I have additive scenes, and I want to have my transparent sphere in one scene and the objects sorted in another scene.

Anyway, thanks for your help. I’ll have to reorganize how I handle scene management.

If there’s any chance to add a proper way to dim the passthrough in a future PolySpatial update, it would be a lifesaver for many experiences. As far as I know, a lot of MX apps would benefit from having a dimmed passthrough.

Gabriel

I’m not sure that there’s any way we can add a feature like this using RealityKit aside from just making a translucent black sphere, as you’re doing. Although, it does occur to me that one might be able to use the vertex stage of a shader graph to move the sphere vertices as far back as possible (based on the projection matrix).

However, it’s also worth requesting the ability to dim the passthrough to Apple via their Feedback Assistant.