src/scene.c

changeset 39
7cf310cc47cb
parent 38
6e5629ea4c5c
child 40
6c438be1a1fd
--- a/src/scene.c	Thu Mar 21 20:24:31 2024 +0100
+++ b/src/scene.c	Thu Mar 21 20:34:33 2024 +0100
@@ -102,9 +102,9 @@
         }
 
         // check if geometry needs update
-        if (node->need_full_update) {
+        if (node->need_graphics_update) {
             assert(node->update_func != NULL);
-            node->need_full_update = false;
+            node->need_graphics_update = false;
             node->update_func(node);
         }
         if (node->need_transform_update) {
@@ -150,10 +150,16 @@
         camera->update(camera);
 
         // for the NONE group, the draw func is expected to do everything
+        glEnable(GL_DEPTH_TEST);
+        glDisable(GL_BLEND);
         asc_scene_draw_render_group(scene->rg_none);
 
         // draw the FONTS group
+        glDisable(GL_DEPTH_TEST);
+        glEnable(GL_BLEND);
+        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
         // TODO: see if we can really always ignore the view matrix
+        // TODO: compute render order for alpha blending to work correctly
         glUseProgram(ASC_SHADER_FONT.base.id);
         glUniformMatrix4fv(ASC_SHADER_FONT.base.projection, 1,
                            GL_FALSE, camera->projection);

mercurial