OPENGL_DEPTH_BUFFER_ENABLED = True?

Monkey Forums/Monkey Programming/OPENGL_DEPTH_BUFFER_ENABLED = True?

Richard Betson(Posted 2016) [#1]
Hi,

I am wondering what exactly enabling OPENGL_DEPTH_BUFFER_ENABLED does for mojo2. As I understand it OpenGL uses the depth buffer to determine the fragment 'Z'. From what I can see mojo2 does not allow images or primitives to have a 'Z' so how is enabling the depth buffer useful?


ImmutableOctet(SKNG)(Posted 2016) [#2]
I'm pretty sure that's just a regular OpenGL Z-buffer thing, needed to set up consistent context behavior across targets and all that fun stuff.

Here's the usage in Monkey.

Mojo 2 doesn't do anything 3D, so I imagine depth-testing is disabled/unused regardless. I mean, from what I remember, it pushes everything to the GPU with batch calls to 'glBufferSubData', so it's not like it has an easy way to sort to begin with. Not to mention the lack of real Z positions (Or related projections).


Richard Betson(Posted 2016) [#3]
a regular OpenGL Z-buffer thing, needed to set up consistent context behavior across targets

I would have to agree that it looks like it is only part of the context initialization and nothing more based on your search link.

Just exploring options. ;)


Sicilica(Posted 2016) [#4]
The only reason that option really matters is if you'll be using the opengles modules directly rather than using mojo/mojo2. Since your render target (the GLFW window, WebGL canvas, etc) gets created for you, there are a bunch of preprocessor commands to change it's settings.