|
MeVisLab Resolution Independence API
|
High-resolution displays provide a rich visual experience by showing sharper text and more image details than standard-resolution displays. MeVisLab supports OpenGL rendering on high-resolution displays without reducing readability through small fonts, narrow margins, or thin lines.
OpenGL visualization modules do not support resolution independence out of the box, so they must be adapted. MeVisLab extends the OpenGL render state with a pixel scale factor that simplifies this task. Replace the standard OpenGL calls glLineWidth, glPointSize, and glLineStipple with their new counterparts ml::glLineWidthScaled, ml::glPointSizeScaled, and ml::glLineStippleScaled. Fonts are adapted automatically. For margins and spacing, use the template GLHiDPIScale. The following code snippet outlines some of the adaptations:
Using the SoShader framework, the following uniform can be accessed within the shader code:
uniform float oiv_DevicePixelRatio;