fix depth clearing, ghostly modes not using depth layers, ortho with 0..1

This commit is contained in:
veclav talica 2024-10-14 16:00:27 +03:00
parent 19bf88d44e
commit f087bf1f7f
2 changed files with 5 additions and 2 deletions

View File

@ -159,7 +159,7 @@ void use_2d_pipeline(void) {
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
glOrtho(0, (double)ctx.base_render_width, (double)ctx.base_render_height, 0, -1, 1); glOrtho(0, (double)ctx.base_render_width, (double)ctx.base_render_height, 0, 0, 1);
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); glLoadIdentity();
@ -211,7 +211,7 @@ void use_texture_mode(TextureMode mode) {
glNewList(lists + 0, GL_COMPILE); { glNewList(lists + 0, GL_COMPILE); {
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthFunc(GL_ALWAYS); glDepthFunc(GL_LESS);
glDepthMask(GL_FALSE); glDepthMask(GL_FALSE);
glDisable(GL_ALPHA_TEST); glDisable(GL_ALPHA_TEST);
} glEndList(); } glEndList();

View File

@ -71,6 +71,9 @@ void clear_draw_buffer(void) {
(1.0f / 255) * 230, (1.0f / 255) * 230,
(1.0f / 255) * 230, 1); (1.0f / 255) * 230, 1);
glDepthRange(0.0, 1.0);
glDepthMask(GL_TRUE);
/* TODO: don't clear color when skybox is applied? */ /* TODO: don't clear color when skybox is applied? */
/* for that window should match framebuffer */ /* for that window should match framebuffer */
/* also it is driver dependent, from what i can gather */ /* also it is driver dependent, from what i can gather */