# DISABLE\_DEPTH\_TEST not working in P3D

**URL:** <https://discourse.processing.org/t/disable-depth-test-not-working-in-p3d/5995>\
**Category:** Processing\
**Created:** [November 27, 2018, 2:30pm UTC](https://discourse.processing.org/t/disable-depth-test-not-working-in-p3d/5995 "2018-11-27T14:30:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![clankill3r](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/clankill3r/32/1098_2.png) [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Post date:** [November 27, 2018, 2:30pm UTC](https://discourse.processing.org/t/disable-depth-test-not-working-in-p3d/5995/1 "2018-11-27T14:30:58Z")

</div>

The line is over the ellipses,why? It should be under it:

 ![27](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/3/3f5d764a4bfbe71e14e34771ff621187b6a5e626.png)

So it seems like DISABLE\_DEPTH\_TEST is not working.  
Is there a way to fix?

```auto
void setup() {
  size(640, 480, P3D);
}

void draw() {
  background(0);
  
  rotateX(random(TWO_PI));
  rotateY(random(TWO_PI));
  rotateZ(random(TWO_PI));
  
  begin_2d();
  stroke(255,0,0);
  line(0, 0, width, height);
  fill(255);
  ellipse(0, 0, 50, 50);
  ellipse(width, height, 50, 50);
  end_2d();
  
}

void begin_2d() {
  hint(DISABLE_DEPTH_TEST);
  pushMatrix();
  resetMatrix();
  ortho(0, width, -height, 0, -Float.MAX_VALUE, Float.MAX_VALUE);
}

void end_2d() {
  popMatrix();  
  hint(ENABLE_DEPTH_TEST);
}

```

---

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [November 29, 2018, 2:55pm UTC](https://discourse.processing.org/t/disable-depth-test-not-working-in-p3d/5995/2 "2018-11-29T14:55:15Z")

</div>

Hi! Maybe you can test the different options with this program?

> [@Program to test hint() with transparency](https://discourse.processing.org/t/program-to-test-hint-with-transparency/4361):
>
> A small Processing program to test the effect on transparency of enabling and disabling these settings: hint(DISABLE\_DEPTH\_TEST); // or ENABLE\_ hint(DISABLE\_DEPTH\_SORT); // or ENABLE\_ hint(DISABLE\_DEPTH\_MASK); // or ENABLE\_ boolean b[] = new boolean[3]; void setup() { size(800, 600, P3D); hint(DISABLE\_DEPTH\_TEST); hint(DISABLE\_DEPTH\_SORT); hint(DISABLE\_DEPTH\_MASK); } void draw() { background(255); fill(0); text("DEPTH\_TEST " + b[0]…

By enabling DEPTH\_SORT it seems to render what you expect…

---

<div class="post-metadata">

**Author:** ![clankill3r](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/clankill3r/32/1098_2.png) [@clankill3r](https://discourse.processing.org/u/clankill3r)\
**Post date:** [November 29, 2018, 3:56pm UTC](https://discourse.processing.org/t/disable-depth-test-not-working-in-p3d/5995/3 "2018-11-29T15:56:20Z")

</div>

thanks! It finally works now.
