View Full Version : how to turn off drawing to the window?

08-18-2015, 09:25 AM
i got this answer before in another question i asked but it has since been deleted. I have a shader program that only has a vertex shader but when i run it i still get some output on the screen. so i was wondering; how i can turn off the output for my program? thanks :)

08-18-2015, 11:40 AM
glColorMask (0, 0, 0, 0) will do it.

Alfonse Reinheart
08-18-2015, 12:07 PM
A better solution would be glEnable(GL_RASTERIZER_DISCARD) (https://www.opengl.org/wiki/Rasterizer_Discard).

08-18-2015, 12:39 PM
Do you want to disable output or disable rasterisation entirely?

GL_RASTERIZER_DISCARD will skip the entire rasterisation process.

Using glColorMask (or glDrawBuffer(GL_NONE)) will still perform rasterisation; it just won't modify the colour buffer. It will still update the depth and stencil buffers (unless those are also disabled), sample counts, and any images, buffer variables or atomic variables written by a fragment shader.

08-18-2015, 12:58 PM
i want to disable rasterization entirely. im gonna use glEnable(GL_RASTERIZER_DISCARD) thanks guys :)