I am a newby of spatial computing. Here I am learning how to use ARKit to capture the environment texture and apply it on a ModelEntity of RealityKit on Vision Pro. But I do not find a demo of how to use EnvironmentLightEstimationProvider
.
After checking the documentation, I also have some questions:
EnvironmentProbeAnchor.environmentTexture
is aMTLTexture
, butEnvironmentResource
needs aCGImage
. How do I translateMTLTexture
toCGImage
(Forgive me that I do not know much about Metal or other framework, so It will be better if there is a code that I can copy and paste directly)- It seems that the
EnvironmentProbeAnchor
can only get the light information around the device. But what should I do if I want get the light information around theModelEntity
so that I can apply the environment texture on it.
It will be better if you can provide a code demo about how to use the new api.
Thank you!