Fallback for if GL_ARB_clip_control not available

If GL_ARB_clip_control not available then [znear, zfar] -> [1, -1] instead of [1, 0] in normalized device coordinates

Thus, Z is still reversed, but not shifted, clipping should still work properly, and conversion to window coordinates does not cause accuracy regression compared to non-reversed Z rendering.
This commit is contained in:
Levi Burner
2023-10-02 18:20:58 -04:00
parent 9868486af0
commit c6961b77d7
3 changed files with 31 additions and 11 deletions
-3
View File
@@ -1489,9 +1489,6 @@ void mjr_makeContext_offSize(const mjModel* m, mjrContext* con, int fontscale,
if (!mjGLAD_GL_ARB_vertex_buffer_object) {
mju_error("OpenGL ARB_vertex_buffer_object required");
}
if (!mjGLAD_GL_ARB_clip_control) {
mju_error("OpenGL ARB_clip_control required");
}
if (!mjGLAD_GL_ARB_depth_buffer_float) {
mju_error("OpenGL ARB_depth_buffer_float required");
}