# Think Camera.minZ & maxZ a little extreme for XR (very minor)

**URL:** <https://forum.babylonjs.com/t/think-camera-minz-maxz-a-little-extreme-for-xr-very-minor/26315>\
**Category:** Feature requests\
**Tags:** webxr\
**Created:** [December 27, 2021, 6:31pm UTC](https://forum.babylonjs.com/t/think-camera-minz-maxz-a-little-extreme-for-xr-very-minor/26315 "2021-12-27T18:31:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [December 27, 2021, 6:31pm UTC](https://forum.babylonjs.com/t/think-camera-minz-maxz-a-little-extreme-for-xr-very-minor/26315/1 "2021-12-27T18:31:18Z")

</div>

For XR, where meters is the required unit of scale, it seems using the default maxZ from Camera of 10000 ( 6.2 miles) is an unlikely value which would chosen by someone. 50 or 100 meters seems more reasonable.

Bringing the value down would help in the z-order fighting cause, & may also allow for a lower default for minZ which is over ridden to 0.1 (4 inches) on XR. Things disappearing at 4 inches for this kind of device seems a little early. Maybe .01 would be better.

While these are just defaults which anyone can change, I think better than can be done.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [January 3, 2022, 2:39pm UTC](https://forum.babylonjs.com/t/think-camera-minz-maxz-a-little-extreme-for-xr-very-minor/26315/2 "2022-01-03T14:39:34Z")

</div>

I love the idea !!! adding @RaananW to integrate the fix (as I am afraid of breaking it 🙂 )

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [January 4, 2022, 3:47pm UTC](https://forum.babylonjs.com/t/think-camera-minz-maxz-a-little-extreme-for-xr-very-minor/26315/3 "2022-01-04T15:47:29Z")

</div>

sure! I am totally for it. I wouldn’t make the maxZ so low, especially since the default size of the skybox is 1000, but lowering it to 1100 and setting a new minZ makes a lot of sense. I’ll experience with it a bit, but if you want to submit a PR after testing it yourself, please do! 🙂

---

<div class="post-metadata">

**Author:** ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)\
**Post date:** [January 4, 2022, 4:47pm UTC](https://forum.babylonjs.com/t/think-camera-minz-maxz-a-little-extreme-for-xr-very-minor/26315/4 "2022-01-04T16:47:32Z")

</div>

1100 makes sense for max, so that the default sky box works. Thanks for bringing that up, BTW.

I have a Blender implemented, high res, Picture dome (a @gryff trick that allows it to be rotate-able in Blender). I was having it be the exact diameter of the circular floor. I looks very good, but making the sphere bigger than the floor space would allow the it to seem even more real as you approached the balcony / edge, since you could start to see the sky as well as below.

Here is a side view with a back face culled wall outlined in red. The reason I am mentioning this is that sky boxes DO NOT look even close to real in XR, due to resolution limits of 3D textures. I do not recommend them. This image is 4000 x 8000. Will probably test the performance of converting it to a ASTC sometime soon too.

 ![theStudiosFromSide](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/7/7/775133b9e5d886dc8afb7d206382f6878fbd45f8.jpeg)

Right now, I need to dig the shrapnel out of my foot & get my GUI working again. I wanted to put a toggle button on an arm controller supported by my GUI, which would bring the walls up / down to get more room for certain animation unit tests. The buttons that are on the walls need to be much bigger than a touchable button, but I only had one scene wide scale. I have multiple scales now, but nothing shows up.
