Mirroring a Mesh onto glass

Hello guys, I do have a virtual environment in which I have a mesh. I want the mesh to be mirrored onto a glass which is very close nearby.

I can't just duplicate it because it varies depending on from which position you are looking at it.

Is there a possibility to mirror a mesh via reflections? It shouldn't reflect real world objects - just a virtual mesh.

Thank you guys

Answered by Vision Pro Engineer in 790789022

This is possible. Follow these steps:

The session Optimize your 3D assets for spatial computing covers the use of the ImageBasedLightComponent and the ImageBasedLightReceiverComponent. The relevant portion is at the ~16min mark.

Here are 2 semi related tips:

  • You can use EnvironmentLightingConfigurationComponent (released in visionOS Beta 2) with environmentLightingWeight set to 0 to remove the surrounding environment lighting.

  • Glass varies in appearance. Here are some PBR settings to get you started.

var material = PhysicallyBasedMaterial()
material.baseColor = .init(tint:  UIColor(red: 0.5, green: 0.5, blue: 0.5, alpha: 0))
material.metallic = 0.0
material.roughness = 0.05
material.specular = 0.5
material.blending  = .transparent(opacity: .init(0.5))

Or in other words: can I create a Shader with the Shader Graph to reflect other meshes?

This is possible. Follow these steps:

The session Optimize your 3D assets for spatial computing covers the use of the ImageBasedLightComponent and the ImageBasedLightReceiverComponent. The relevant portion is at the ~16min mark.

Here are 2 semi related tips:

  • You can use EnvironmentLightingConfigurationComponent (released in visionOS Beta 2) with environmentLightingWeight set to 0 to remove the surrounding environment lighting.

  • Glass varies in appearance. Here are some PBR settings to get you started.

var material = PhysicallyBasedMaterial()
material.baseColor = .init(tint:  UIColor(red: 0.5, green: 0.5, blue: 0.5, alpha: 0))
material.metallic = 0.0
material.roughness = 0.05
material.specular = 0.5
material.blending  = .transparent(opacity: .init(0.5))

I would like the reflections to be like this. I maybe explained it wrong. It should fully mirror the texture that I have onto another texture.

What I've also forgot to say is that it's an immersive space so we see the real world and the virtual things. So I don't only want to reflect my environment but also a virtual item onto another.

Mirroring a Mesh onto glass
 
 
Q