# VR on pico does not clear buffer

**URL:** <https://forum.needle.tools/t/vr-on-pico-does-not-clear-buffer/2370>\
**Category:** 🌵 Needle Engine\
**Tags:** question\
**Created:** [March 20, 2025, 12:05pm UTC](https://forum.needle.tools/t/vr-on-pico-does-not-clear-buffer/2370 "2025-03-20T12:05:11Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![vydymil](https://forum.needle.tools/user_avatar/forum.needle.tools/vydymil/32/3458_2.png) [@vydymil](https://forum.needle.tools/u/vydymil)\
**Post date:** [April 9, 2025, 9:04am UTC](https://forum.needle.tools/t/vr-on-pico-does-not-clear-buffer/2370/20 "2025-04-09T09:04:50Z")

</div>

Okay, I just tested it. The `ctx.renderer.clearDepth()` doesnt do anything alone. So I played around with the buffer clearing, and found out, that when i call `clearColor()`, it resembles this [three.js examples](https://threejs.org/examples/?q=vr#webxr_vr_sandbox) (so the model is like flickering, but there is no depth overlay, like here [VR on pico does not clear buffer](https://forum.needle.tools/t/vr-on-pico-does-not-clear-buffer/2370)), and if i run either `clearDepth() and clearColor()` or `clear()`, it works fine. So for now, I would say the fix is add this snippet to the main.ts:

```auto
onBeforeRender(ctx => {
    if(ctx.isInXR) ctx.renderer.clear();
})

```

But I dont understand why clearing of the color buffer resolves most of the problem.

---

_[View the full topic](https://forum.needle.tools/t/vr-on-pico-does-not-clear-buffer/2370)._
