helios

A rendering library for Minecraft Forge 1.8.9 on LWJGL 3, OpenGL 4.1 core only.

OpenGL in Helios

Helios targets one thing: an OpenGL 4.1 core profile context, as lol.trq.lazarus creates when the game starts with -Dlazarus.gl=core. There is no legacy-context path, no GLSL 1.20, no second shader dialect and no fixed-function fallback. macOS stops at 4.1, so nothing newer is used anywhere.

The context check

Gl41CoreBackend (created by MinecraftHelios.create()) checks, once the game’s context exists, that GL_CONTEXT_PROFILE_MASK has the core bit and the version is 4.1 or higher, and that Lazarus’s emulator is loaded. If not, it throws:

Helios requires an OpenGL 4.1 core profile context (got <version>). Start the game through Lazarus with -Dlazarus.gl=core.

How Lazarus core mode affects Helios

Lazarus rewrites the OpenGL calls of every game class, Helios included:

Which LWJGL class for which call

Call Class Why
Bind a buffer, program or vertex array GL15, GL20, GL30 (no C) Lazarus intercepts these and keeps its binding cache true
Draw GL11C.glDrawArrays, GL11C.glDrawElements, GL32C.glDrawElementsBaseVertex GL11.glDrawArrays is sent to the fixed-function emulator, which would replace Helios’s program
Enable/disable, glIsEnabled, bind a texture, active texture GL11, GL13 The emulator tracks these, so glIsEnabled is answered without a driver query
Read the game’s matrices the emulator’s glGetFloat(GL_MODELVIEW_MATRIX / GL_PROJECTION_MATRIX) Answered from the emulated matrix stacks; there are no matrix stacks in core
Everything else the C classes Passed to the driver after the emulator flushes

Gl41CoreBackend is the only class that makes these calls; everything else goes through GlBackend.

Shader dialect

Not available on 4.1, so never used: compute shaders, SSBOs, image load/store, atomic counters, explicit uniform locations, glTexStorage, ARB_buffer_storage (persistent or coherent mapping), KHR_debug. Uniform buffers (std140), texture buffers and fence syncs are fine.

Drawing rules

What macOS can’t do

Apple’s OpenGL stops at 4.1 core (on Apple silicon it runs on Metal, reported as “4.1 Metal”). Beyond the list above: no debug output callbacks, so Lazarus’s -Dlazarus.gl.debug=true reports nothing there; and buffer uploads that touch memory the GPU may still read are expensive, which is why uploads are batched and ring-buffered.

Testing

The harness runs only in core mode:

./gradlew :harness:runHarness25 -PjvmArgs="-Dlazarus.gl=core -Dlazarus.gl.debug=true"

Core mode ships in Lazarus 0.2.0; the harness downloads the 0.4.2 release, and -PlazarusJar=<jar> runs a local build instead. With debug on, Lazarus prints every driver GL error with its Java call site as [lazarus] GL error: ...; the harness fails the run on any such line. CI does the same under Xvfb with Mesa, whose llvmpipe supports core 4.5. With OptiFine (-Poptifine=<jar>, local only), -PfastRender turns its Fast Render on for the run; every check must still pass.