Pass cube map to metal shader in RealityKit 2

I would like to pass in a cube map to a custom material shader in RealityKit 2 so I can achieve effects like custom reflections and iridescence.

I am aware of material.custom.texture and material.custom.value as talked about here: https://developer.apple.com/forums/thread/682632

But those only allow for a 2D texture and a                     simd_float4 (a vector of 4 float values).

And I am aware of how to pass in animatable custom parameters as talked about here: https://developer.apple.com/forums/thread/682632

But I would like to be able to sample a cube map instead of a 2D texture. Any help is much appreciated.

If you split the cube map up into six 2D textures and store then in BaseColor, Metallic, etc, you could access them and sample them in your shader. Also, we do support IBLs, but you can’t access those from a custom shader.

Pass cube map to metal shader in RealityKit 2
 
 
Q