NewsCrawler.org

Why an instructor still teaches OpenGL ES 3.0 in an introductory graphics course

Why an instructor still teaches OpenGL ES 3.0 in an introductory graphics course
Image: news.hada.io

Elias Farhan, who teaches the one-semester introductory computer graphics module at SAE Institute Geneva, still uses OpenGL ES 3.0[1] and explains why he has not switched to a modern API. The course goal is to implement a specific 3D scene with a graphics API, not to build a general-purpose, data-driven renderer; an implementation that culls the scene from the camera's viewpoint and draws each object directly in code is acceptable. The mobile graphics API, released in August 2012, was chosen mainly for cross-platform reach: one C++ program with a few #ifdef blocks and the same shaders run on Windows (via OpenGL 4.3, which is compatible with ES 3.0, to reduce driver problems), Linux, Android and the school's two Nintendo Switch dev kits.

The biggest advantage is running the examples as WebGL2[2] through Emscripten[3], which lets students publish them on their own websites or blogs; the exception is floating-point color attachments, which require an extension. The course follows the structure of learnopengl.com with weekly examples such as Hello Triangle and Hello Texture, and this year students built their abstractions together in a shared Git repository that the whole class reuses. Because the driver handles synchronization, students write less repetitive initialization code than with modern APIs, at the cost of driver overhead and the old API's confusing resource management; a recurring nuisance is Windows laptops picking the Intel integrated GPU instead of the Nvidia one.

Concepts that ES 3.0 cannot implement — SSBOs[4], compute shaders, GPU-driven rendering, hardware ray tracing and multithreaded command generation — are covered conceptually only. Switching to a modern API or a framework such as SDL GPU API, bgfx, raylib or WebGPU would require porting all course materials, which he does not consider justified while the goal is learning the graphics API directly and building abstractions on top of it. Debugging is taught with KHR_debug, glObjectLabel and RenderDoc, and although exams explicitly ban solving tasks with LLMs, students increasingly use them to check code and find errors. The results of the course over the years can be seen in the work of Fabian Huber, Samuel Styles, Olivier Pachoud, Constantin Verine, Remy Lambert and Maxime Roch.

Read the original eliasfarhan.chDiscussion on GeekNews

Discussion

On Hacker News, commenters mostly debate whether OpenGL belongs in teaching at all: several say its state machine and poor error handling make debugging painful and would teach WebGPU or browser-based WebGL2 instead, noting that WebGPU works from C++, Rust and JS/TS and is closer to modern GPU programming. Others counter that WebGL2 has much better validation and error reporting than desktop OpenGL, that OpenGL is acceptable specifically for teaching GPU rendering, and that it should be limited to about a month of introduction before moving to Vulkan. Further remarks range from nostalgia for the 1990s NeHe tutorials to the view that AI tools can now generate and debug such low-level details.

Sources

Published: First seen: Читать по-русски

Open as a page