I am trying to load gltf files using three gltf-loader but there happen to be some distortions with few of the models, so I tried decreasing the ‘camera.near’ value. But when it is reduced, some models get clipped early i.e, the models go behind the camera. So I would like to set the ‘camera.near’ value for each object. What will be the best way to calculate the same?
camera.far are used to configure the shared depth buffer, they can’t be changed on a per-object basis. Try to make
camera.far as low as it can safely be without clipping, and
camera.near as high as it can safely be without clipping, to maximize depth buffer precision. Enabling a logarithmic depth buffer can sometimes be helpful for scenes with a very large variation in object distances.
Thank you @donmccurdy for your reply, I thought It would be possible to compute the near and far planes using the bounding box