helios

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

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.

API reference OpenGL rules Source on GitHub

Requirements

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