forked from AuroraMiddleware/gtk
gsk: Enable depth testing
Use the appropriate depth testing function for transparent items.
This commit is contained in:
parent
c052443633
commit
b98fb07419
@ -845,6 +845,13 @@ gsk_gl_renderer_render (GskRenderer *renderer,
|
||||
gsk_gl_renderer_clear (self);
|
||||
|
||||
glDisable (GL_BLEND);
|
||||
if (self->has_depth_buffer)
|
||||
{
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
glDepthFunc (GL_LESS);
|
||||
}
|
||||
else
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
|
||||
/* Opaque pass: front-to-back */
|
||||
GSK_NOTE (OPENGL, g_print ("Rendering %u opaque items\n", self->opaque_render_items->len));
|
||||
@ -855,6 +862,12 @@ gsk_gl_renderer_render (GskRenderer *renderer,
|
||||
render_item (self, item);
|
||||
}
|
||||
|
||||
if (self->has_depth_buffer)
|
||||
{
|
||||
glEnable (GL_DEPTH_TEST);
|
||||
glDepthFunc (GL_LEQUAL);
|
||||
}
|
||||
|
||||
glEnable (GL_BLEND);
|
||||
glBlendFuncSeparate (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
|
||||
glBlendEquation (GL_FUNC_ADD);
|
||||
|
Loading…
Reference in New Issue
Block a user