Add flag to mjrContext to support legacy depth mapping by default

This commit is contained in:
Levi Burner
2023-09-26 13:34:00 -04:00
parent d32eb6bd12
commit 2e52bf807b
8 changed files with 40 additions and 0 deletions
+7
View File
@@ -39,6 +39,10 @@ typedef enum mjtFramebuffer_ { // OpenGL framebuffer option
mjFB_OFFSCREEN // offscreen buffer
} mjtFramebuffer;
typedef enum mjtDepthMapping_ { // OpenGL depth buffer readout mapping (from znear to zfar)
mjDM_ZEROTOONE = 0, // Legacy default, reverses reversed Z rendering, performance penalty
mjDM_ONETOZERO // Native output of reversed Z rendering, decreases numerical error
} mjtDepthMapping;
typedef enum mjtFontScale_ { // font scale, used at context creation
mjFONTSCALE_50 = 50, // 50% scale, suitable for low-res rendering
@@ -151,6 +155,9 @@ struct mjrContext_ { // custom OpenGL context
// pixel output format
int readPixelFormat; // default color pixel format for mjr_readPixels
// depth output format
int readDepthMapping; // depth mapping, 0 to 1 (default, legacy), or 1 to 0 (reversed, native)
};
typedef struct mjrContext_ mjrContext;