# Babylon native error "reverse depth buffer is not currently implemented"

**URL:** <https://forum.babylonjs.com/t/babylon-native-error-reverse-depth-buffer-is-not-currently-implemented/49988>\
**Category:** Questions\
**Created:** [April 24, 2024, 3:14pm UTC](https://forum.babylonjs.com/t/babylon-native-error-reverse-depth-buffer-is-not-currently-implemented/49988 "2024-04-24T15:14:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [April 24, 2024, 3:14pm UTC](https://forum.babylonjs.com/t/babylon-native-error-reverse-depth-buffer-is-not-currently-implemented/49988/1 "2024-04-24T15:14:30Z")

</div>

We just started getting this error when rendering via babylon native:

```auto
Error: reverse depth buffer is not currently implemented
   at clear (app:///Scripts/api.spectrum-renderer.js:152420:11)
   at activate (app:///Scripts/api.spectrum-renderer.js:71945:11)
   at _prepareFrame (app:///Scripts/api.spectrum-renderer.js:31774:9)
   at _renderForCamera (app:///Scripts/api.spectrum-renderer.js:40345:11)
   at _processSubCameras (app:///Scripts/api.spectrum-renderer.js:40411:11)
   at render (app:///Scripts/api.spectrum-renderer.js:40719:11)
   at scene.render (app:///Scripts/api.spectrum-renderer.js:152347:11)
   at renderSpectrumAssetAsync (app:///Scripts/index.js:231:9)
   at Generator.prototype.next (native code)

```

Im no sure what we are doing that utilizes reverse depth buffer. Recently we added refractionTexture to create dynamic refractions.

We are using the latest Babylon Native at this commit  
commit 8d61e153094c147ecb3979e20ce4c4a914048dd3  
and BabylonJS 7.3.2

I see there have been some updates to Native since then. I’ll try pulling in the latest native and see if the error goes away.

@bghgary

---

<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:** [April 24, 2024, 4:47pm UTC](https://forum.babylonjs.com/t/babylon-native-error-reverse-depth-buffer-is-not-currently-implemented/49988/2 "2024-04-24T16:47:32Z")

</div>

cc [@BabylonNative](https://forum.babylonjs.com/groups/babylonnative)

---

<div class="post-metadata">

**Author:** ![srzerbetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/srzerbetto/32/20941_2.png) [@srzerbetto](https://forum.babylonjs.com/u/srzerbetto)\
**Post date:** [April 24, 2024, 5:34pm UTC](https://forum.babylonjs.com/t/babylon-native-error-reverse-depth-buffer-is-not-currently-implemented/49988/3 "2024-04-24T17:34:09Z")

</div>

We had some issues with Babylon Native updated to Babylon.js 7.0, could you guys verify if that works with Babylon.js 6.49.0?

@bghgary , could this be related to the things you were fixing?

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [April 26, 2024, 3:48pm UTC](https://forum.babylonjs.com/t/babylon-native-error-reverse-depth-buffer-is-not-currently-implemented/49988/4 "2024-04-26T15:48:48Z")

</div>

Sorry for the slow response. This should not be related to my changes. @sebavan @Evgeni_Popov Anyone know if refraction uses reverse depth buffer?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [April 26, 2024, 8:59pm UTC](https://forum.babylonjs.com/t/babylon-native-error-reverse-depth-buffer-is-not-currently-implemented/49988/5 "2024-04-26T20:59:15Z")

</div>

We don’t set any value to `useReverseDepthBuffer` in Babylon, except `false` at initialization time, so I’m not sure why this variable is `true` for you…

---

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [April 29, 2024, 5:44am UTC](https://forum.babylonjs.com/t/babylon-native-error-reverse-depth-buffer-is-not-currently-implemented/49988/6 "2024-04-29T05:44:18Z")

</div>

> [@Evgeni\_Popov](#):
>
> useReverseDepthBuffer

That is the question. what is causing that value to be set to true. I will have to step backward in our builds to see when the problem started and will report back. As said the only thing we added was dynamic reflection/refraction texture stuff.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [April 29, 2024, 3:51pm UTC](https://forum.babylonjs.com/t/babylon-native-error-reverse-depth-buffer-is-not-currently-implemented/49988/7 "2024-04-29T15:51:29Z")

</div>

If there is a repro, it should be relatively straight-forward to determine why the flag is set.
