Bug
Cockpit mesh is invisible in cockpit camera mode (F10). HUD elements render fine.
Root Cause
aircrafts_prepare_render (aircraft.cpp:639) calls glDisable(GL_CULL_FACE) before pushing cockpit meshes to the canvas, then glEnable(GL_CULL_FACE) at line 653. No GL draws happen between those calls — only canvas_add pushes to a Vec. The actual glDrawArrays happens later in canvas_render_meshes, at which point GL_CULL_FACE is enabled (leaked from line 653). The cockpit interior faces (back-facing from camera POV inside the cockpit) are culled → cockpit invisible.
The original analysis blamed GL_DEPTH_TEST, but the depth test is irrelevant here — the HUD renders correctly on top of the scene because it runs after the scene draw and uses its own orthographic projection. The real issue is face culling.
Fix
- Add a separate
list_cockpit mesh list to Canvas::meshes
- Push cockpit meshes there instead of
list_regular
- Render
list_cockpit in canvas_render_meshes wrapped in glDisable(GL_CULL_FACE) / glEnable(GL_CULL_FACE)
- Remove the dead
glDisable/glEnable(GL_CULL_FACE) from the push site in aircraft.cpp
Bug
Cockpit mesh is invisible in cockpit camera mode (F10). HUD elements render fine.
Root Cause
aircrafts_prepare_render(aircraft.cpp:639) callsglDisable(GL_CULL_FACE)before pushing cockpit meshes to the canvas, thenglEnable(GL_CULL_FACE)at line 653. No GL draws happen between those calls — onlycanvas_addpushes to aVec. The actualglDrawArrayshappens later incanvas_render_meshes, at which pointGL_CULL_FACEis enabled (leaked from line 653). The cockpit interior faces (back-facing from camera POV inside the cockpit) are culled → cockpit invisible.The original analysis blamed
GL_DEPTH_TEST, but the depth test is irrelevant here — the HUD renders correctly on top of the scene because it runs after the scene draw and uses its own orthographic projection. The real issue is face culling.Fix
list_cockpitmesh list toCanvas::mesheslist_regularlist_cockpitincanvas_render_mesheswrapped inglDisable(GL_CULL_FACE)/glEnable(GL_CULL_FACE)glDisable/glEnable(GL_CULL_FACE)from the push site inaircraft.cpp