Will babylon.js support 32bit depth buffer

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!

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.

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.

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

1 Like

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

1 Like

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

this link has a webgl2 specification, where i find
const GLenum DEPTH_COMPONENT32F = 0x8CAC;
const GLenum DEPTH32F_STENCIL8 = 0x8CAD;


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

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?

Yup, it only changes precision.

WOW, that’s great!!

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

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