# hint(DISABLE\_DEPTH\_TEST) in P5

**URL:** https://discourse.processing.org/t/hint-disable-depth-test-in-p5/5595
**Category:** p5.js
**Created:** [November 16, 2018, 11:28am UTC](https://discourse.processing.org/t/hint-disable-depth-test-in-p5/5595 "2018-11-16T11:28:20Z")
**Posts on this page:** 1
**Showing post:** 5

<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 16, 2018, 12:20pm UTC](https://discourse.processing.org/t/hint-disable-depth-test-in-p5/5595/5 "2018-11-16T12:20:37Z")

</div>

> [@FedFod](#):
>
> Just realised that it doesn’t work in run time

For me it works (click to toggle):

```auto
var gl;
var b = true;
function setup() {
	createCanvas(400, 400, WEBGL);
	gl = document.getElementById('defaultCanvas0').getContext('webgl');
}

function draw() {
	background(0);
	noStroke();

	fill(255, 200, 30);
	rotateY(frameCount * 0.01);
	box(200);
	
	fill(30, 200, 255);
	rotateY(PI * 0.25);
	box(200);
}
function mousePressed() {
	if(b) {
		gl.disable(gl.DEPTH_TEST);
	} else {
		gl.enable(gl.DEPTH_TEST);
	}
	b = !b;
}

```

Run it at [p5.js Web Editor](https://editor.p5js.org/abe/sketches/rJm884hTQ)

---

_[View the full topic](https://discourse.processing.org/t/hint-disable-depth-test-in-p5/5595)._
