How can I disable viewport culling in RealityKit?

I'm using a geometry modifier to displace vertices well beyond their original position. When viewing this displaced mesh in an .ar RealityKit view, the mesh disappears when the mesh's pre-modified coordinates fall outside of the viewing frustum. There's usually only this mesh in the scene, so it is weird for the user to walk up to the mesh they see, only for it to go away.

Is there a way to disable viewport culling in RealityKit or in my geometry modifier? Or, is it possible to set the culling to happen after the geometry modifier has displaced the mesh?

(I looked at this answer, but it looked like that person was building custom geometry in a Metal view.)

Answered by Graphics and Games Engineer in 696822022

Hi, you can't disable culling, but you can use this API https://developer.apple.com/documentation/realitykit/modelcomponent/3768526-boundsmargin to extend the bounds of your model so that it is not culled.

Accepted Answer

Hi, you can't disable culling, but you can use this API https://developer.apple.com/documentation/realitykit/modelcomponent/3768526-boundsmargin to extend the bounds of your model so that it is not culled.

How can I disable viewport culling in RealityKit?
 
 
Q