A rendering library for Minecraft Forge 1.8.9 running on LWJGL 3: SDF shapes, MSDF text, shaders, framebuffers, blur and bloom, with strict GL state discipline so vanilla and OptiFine keep a coherent state.
Status: early development (milestone H3.5), nothing released yet. See CHANGELOG.md.
Requirements
- Minecraft 1.8.9 with Forge 11.15.1.2318, on Java 17 or newer, running on LWJGL 3 through lol.trq.lazarus.
- Lazarus 0.2.0 or newer in core mode (
-Dlazarus.gl=core): an OpenGL 4.1 core profile context, on Windows, Linux and macOS. Every shader is#version 410 core; there is no legacy-context path. Helios checks this at start-up and says how to fix it. See docs/opengl.md for the dialect and the drawing rules.
Usage
// On the render thread, once the window exists:
Helios helios = MinecraftHelios.create();
// In a GuiScreen draw, in GUI units. pixel is one framebuffer pixel in those units.
float pixel = 1f / scaledResolution.getScaleFactor();
helios.shapes().begin(pixel)
.shadow(12, 14, 120, 48, 8, 6, 0x66000000)
.rect(12, 12, 120, 48, 8, Paint.vertical(0xFF3B82F6, 0xFF1D4ED8))
.outline(12, 12, 120, 48, 8, 1, Paint.solid(0x40FFFFFF))
.arc(160, 36, 20, 4, (float) -Math.PI / 2, 4.2f, Paint.solid(0xFFF59E0B))
.line(190, 20, 240, 50, 2, true, Paint.horizontal(0xFF22D3EE, 0xFFA855F7))
.end(); // one draw call
// Frosted glass and bloom work on what is already drawn.
helios.effects().blurBehind(12, 70, 120, 48, 8, pixel, 3, 2, 0xFFFFFFFF);
helios.effects().bloom(() -> helios.shapes().begin(pixel).circle(60, 140, 10, Paint.solid(0xFFFF3060)).end(),
3, 1.5f, 1f);More examples (text, animation, world to screen, meshes, stencil clipping, shader reload) are in the README.
Links
- OpenGL in Helios: the dialect and the drawing rules
- Javadoc for
lol.trq.helios - Benchmarks and the changelog
- Lazarus, the runtime Helios needs