You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Viewer: detect software OpenGL and choose the drawing path; smooth fixed-size labels on hardware renderers #566
ECCE does not know which OpenGL renderer it is running on. Two recent changes to label drawing work around problems that appear to occur with software rendering, but apply to every renderer:
Use fixed-pixel text for 3D viewer labels #538 changed the 3D viewer labels to the 9×15 fixed-pixel bitmap font, so labels keep their size when zooming. On hardware renderers this font is blocky (no antialiasing).
Fix GTK activation and Builder MO rendering #565 draws the viewer's corner text as screen-space quads instead of glBitmap display lists, because glBitmap was reported to crash under a software renderer while MOs were shown. Measurement and lattice labels (AtomMeasureDist.C, AtomMeasureAngle.C, SGLattice.C) still use glBitmap display lists.
Proposal:
Read GL_RENDERER once, when the first viewer context is made. Classify the renderer as software if it matches llvmpipe, softpipe, swrast, SVGA3D (VMware), virgl, "Microsoft Basic Render Driver", "GDI Generic" or "Apple Software Renderer".
Open question: whether the crash under software rendering is caused by glBitmap at all. A reproduction with a large conjugated molecule's MOs, on hardware and software renderers, should come first.
Font, once the renderer detection is in: settle the label font so that it suits both uses — readable and fixed-size labels on software renderers and VMs (the reason for #538), and smooth antialiased text on hardware renderers (the 9×15 bitmap font looks blocky there). Compare candidates side by side as screenshots on both renderers before choosing.
Sized 10-26: steps 1, 2, 4, 5 (detect GL_RENDERER, software path for all viewer text + quick transparency, ECCE_GL_PATH + preference, report in About/Report a Problem/stderr) are small enough for 9.4.1. Step 3 and the font choice (antialiased fixed-size labels on hardware, side-by-side screenshots) come after 9.4.1.
Steps 1, 2, 4, 5 merged (74580fe, in 9.4.1): GL_RENDERER read at the first viewer frame; on software renderers all viewer text is drawn as geometry and transparency starts in the quick mode; ECCE_GL_PATH=software|hardware and Edit > Preferences > Advanced > OpenGL drawing override it; the renderer and chosen path are on stderr, in Help > About and in Report a Problem. Hardware renderers draw as before. Step 3 and the font choice remain.
Step 3, decided (Andy 10-26): a label font setting in Edit > Preferences: System (default), DejaVu Sans, Noto Sans, Liberation Sans, Fixed 9×15 (bitmap); size in pixels, so labels keep their size when zooming (#538). Hardware renderers: the chosen font, antialiased (each label rasterised once through wx and drawn as one screen-space textured quad). Software renderers keep the 9×15 geometry text whatever the setting (no textures there, the path #565 worked around); a note by the setting says so; ECCE_GL_PATH / the OpenGL drawing preference still override. DejaVu Sans bundled in the Windows and macOS packages. Tests: label pixels on both paths, software path ignores the font setting; real-click checks on Windows and macOS. Planned first for 9.4.2.
Activity
ohlincha commentedon Oct 26, 2026
Font, once the renderer detection is in: settle the label font so that it suits both uses — readable and fixed-size labels on software renderers and VMs (the reason for #538), and smooth antialiased text on hardware renderers (the 9×15 bitmap font looks blocky there). Compare candidates side by side as screenshots on both renderers before choosing.
ohlincha commentedon Oct 26, 2026
Andy 10-26: in 9.4.1 if reasonably small; size to be assessed first.
ohlincha commentedon Oct 26, 2026
Sized 10-26: steps 1, 2, 4, 5 (detect GL_RENDERER, software path for all viewer text + quick transparency, ECCE_GL_PATH + preference, report in About/Report a Problem/stderr) are small enough for 9.4.1. Step 3 and the font choice (antialiased fixed-size labels on hardware, side-by-side screenshots) come after 9.4.1.
ohlincha commentedon Oct 26, 2026
Steps 1, 2, 4, 5 merged (74580fe, in 9.4.1): GL_RENDERER read at the first viewer frame; on software renderers all viewer text is drawn as geometry and transparency starts in the quick mode; ECCE_GL_PATH=software|hardware and Edit > Preferences > Advanced > OpenGL drawing override it; the renderer and chosen path are on stderr, in Help > About and in Report a Problem. Hardware renderers draw as before. Step 3 and the font choice remain.
ohlincha commentedon Oct 26, 2026
Step 3, decided (Andy 10-26): a label font setting in Edit > Preferences: System (default), DejaVu Sans, Noto Sans, Liberation Sans, Fixed 9×15 (bitmap); size in pixels, so labels keep their size when zooming (#538). Hardware renderers: the chosen font, antialiased (each label rasterised once through wx and drawn as one screen-space textured quad). Software renderers keep the 9×15 geometry text whatever the setting (no textures there, the path #565 worked around); a note by the setting says so; ECCE_GL_PATH / the OpenGL drawing preference still override. DejaVu Sans bundled in the Windows and macOS packages. Tests: label pixels on both paths, software path ignores the font setting; real-click checks on Windows and macOS. Planned first for 9.4.2.