<p>I am trying to make it so that objects leave trails behind them and if an object is in the back and tries to draw over a previous trail it is transparent because of it.</p>

<p>The problem is whenever I do not GL_CLEAR the depth buffer after each frame the screen goes blank. Is there a way around this in Open GL ES 2.0?</p>

<p>Diagram:
<a href="https://i.sstatic.net/LPxF6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LPxF6.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2017-03-11T06:48:55.653Z
Could you post some code and a screen shot of what it looks like, and perhaps an example of what you want it to look like?
user1118321
CC BY-SA 3.0
2017-03-11T07:01:51.457Z
@user1118321 Good idea. Added!
J.Doe
CC BY-SA 3.0
2017-03-13T01:00:19.190Z
Could you expand the explanation of what you intend? Do you want the objects to be opaque in all cases *except* when they are behind a trail? Does this apply only to the trails of other objects, or also to an object's own trails?
trichoplax is on Codidact now
<depth-map>
Do you have to clear the depth buffer each frame in OpenGL
J.Doe
# Do you have to clear the depth buffer each frame in OpenGL

(Asked by: username_0 on 2017-03-11)

I am trying to make it so that objects leave trails behind them and if an object is in the back and tries to draw over a previous trail it is transparent because of it.

The problem is whenever I do not GL\_CLEAR the depth buffer after each frame the screen goes blank. Is there a way around this in Open GL ES 2.0?

Diagram:
[![enter image description here](https://i.sstatic.net/LPxF6.png)](https://i.sstatic.net/LPxF6.png)

**Tags:** depth-map

> **Comments:**
> **username_1**: Could you post some code and a screen shot of what it looks like, and perhaps an example of what you want it to look like?  
> **username_0**: @username_1 Good idea. Added!  
> **username_2**: Could you expand the explanation of what you intend? Do you want the objects to be opaque in all cases *except* when they are behind a trail? Does this apply only to the trails of other objects, or also to an object's own trails?  

---

## 0 answers

