# Will babylon.js support 32bit depth buffer

**URL:** <https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496>\
**Category:** Feature requests\
**Created:** [December 10, 2019, 1:51pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496 "2019-12-10T13:51:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chao\_Xu](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/chao_xu/32/5964_2.png) [@Chao\_Xu](https://forum.babylonjs.com/u/Chao_Xu)\
**Post date:** [December 10, 2019, 1:51pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/1 "2019-12-10T13:51:38Z")

</div>

my team is dealing with large landscape display, while the whole scene is so huge and there exist depth fighting, after we use logarithmic depth buffer, the depth fighting gets better but still exists.

We take a lot at the source code and find the engine use a 24bit depth buffer, i know webgl2 has support 32bit depth buffer, so i wonder weather there is a plan to support 32bit depth buffer in babylon. thanks!

---

<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 10, 2019, 2:58pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/2 "2019-12-10T14:58:47Z")

</div>

Not to answer your question, but have you also dropped down your camera.minZ & maxZ, right? They quite broad, so that most people do not need to mess with them.

---

<div class="post-metadata">

**Author:** ![Chao\_Xu](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/chao_xu/32/5964_2.png) [@Chao\_Xu](https://forum.babylonjs.com/u/Chao_Xu)\
**Post date:** [December 10, 2019, 3:17pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/3 "2019-12-10T15:17:17Z")

</div>

yes, camera.minZ & maxZ has set to [10,10000000], and yes, the scene we will render covers a very large area. We have tested logarithmic depth buffer and reversed-z buffer but they are also based on 24bit depth, although the results get better but there still exists flicking.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [December 10, 2019, 3:52pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/4 "2019-12-10T15:52:37Z")

</div>

> [@Chao\_Xu](#):
>
> 32bit depth buffer in babylon

I will add it for you 🙂 Please open an issue on our github (cc @sebavan FYI)

---

<div class="post-metadata">

**Author:** ![Chao\_Xu](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/chao_xu/32/5964_2.png) [@Chao\_Xu](https://forum.babylonjs.com/u/Chao_Xu)\
**Post date:** [December 10, 2019, 4:08pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/5 "2019-12-10T16:08:50Z")

</div>

thanks a lot!!!  
this is the issue link~

> <https://github.com/BabylonJS/Babylon.js/issues/7289>
>
> As discussed in Feature requests section of the forum:
> https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [December 10, 2019, 4:42pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/6 "2019-12-10T16:42:09Z")

</div>

Did you have a reference that states that 32bits depth textures are supported by webgl2?

---

<div class="post-metadata">

**Author:** ![Chao\_Xu](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/chao_xu/32/5964_2.png) [@Chao\_Xu](https://forum.babylonjs.com/u/Chao_Xu)\
**Post date:** [December 10, 2019, 10:48pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/7 "2019-12-10T22:48:13Z")

</div>

this link has a webgl2 specification, where i find  
const GLenum DEPTH\_COMPONENT32F = 0x8CAC;  
const GLenum DEPTH32F\_STENCIL8 = 0x8CAD;

[https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.5](https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.5)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [December 10, 2019, 10:58pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/8 "2019-12-10T22:58:48Z")

</div>

> [@Chao\_Xu](#):
>
> DEPTH\_COMPONENT32F

Ok but that will only be for render target. Is it what you expect?

---

<div class="post-metadata">

**Author:** ![Chao\_Xu](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/chao_xu/32/5964_2.png) [@Chao\_Xu](https://forum.babylonjs.com/u/Chao_Xu)\
**Post date:** [December 10, 2019, 11:06pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/9 "2019-12-10T23:06:20Z")

</div>

only for the render target means when I render my scene into a rendertarget or multi rendertarget，the depth test will based on 32bit float right?

I think that’s what I except.

BTW:will logarithmic depth buffer still can be used on 32bit depth?

---

<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:** [December 11, 2019, 12:51pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/10 "2019-12-11T12:51:44Z")

</div>

> [@Chao\_Xu](#):
>
> BTW:will logarithmic depth buffer still can be used on 32bit depth?

Yup, it only changes precision.

---

<div class="post-metadata">

**Author:** ![Chao\_Xu](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/chao_xu/32/5964_2.png) [@Chao\_Xu](https://forum.babylonjs.com/u/Chao_Xu)\
**Post date:** [December 11, 2019, 1:52pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/11 "2019-12-11T13:52:31Z")

</div>

WOW, that’s great!!

---

<div class="post-metadata">

**Author:** ![Chao\_Xu](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/chao_xu/32/5964_2.png) [@Chao\_Xu](https://forum.babylonjs.com/u/Chao_Xu)\
**Post date:** [December 16, 2019, 7:09am UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/12 "2019-12-16T07:09:09Z")

</div>

Hi,I saw the issue on github has been closed, is this feature will not be supported?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [December 16, 2019, 3:16pm UTC](https://forum.babylonjs.com/t/will-babylon-js-support-32bit-depth-buffer/7496/13 "2019-12-16T15:16:51Z")

</div>

Nope, quite the opposite 🙂 It is in the latest beta 🙂  
On webgl2, rtt will be created with 32bits depth buffer
