makamys / Neodymium

Reimplements chunk rendering using modern OpenGL features to improve performance (1.7.10)
Other
115 stars 10 forks source link

Multiple changes for dynamic VRAM allocation, and compat with FalseTweaks threaded rendering and OptiFine shaders #57

Open FalsePattern opened 4 months ago

FalsePattern commented 4 months ago

This PR contains multiple features that we have added to neodymium on our internal development branch over the past several months. Most of these are deeply coupled with eachother, and as such, we weren't able to split it up into separate PRs without causing breakages between them.

Major changes

Dynamic VRAM allocation

The renderer is no longer restricted to a single VBO, but instead uses multiple sub-VBOs. This way it can support render distances beyond 16 (optifine, falsetweaks, etc.) without issues. Additionally, the VBOs have been split up to be separate for render pass 0 and 1, this simplifies the per-VBO logic and index buffer shuffling

FalseTweaks threading compat

This feature was developed in parallel with FalseTweaks 3.0, and as such will require updating Neodymium before the FT update is released as stable. This mainly added thread safety to various logic that works with the tessellator, as well as exposing some previously internal methods as public API for FalseTweaks to hook the threading logic onto.

Improved OptiFine compatibility

The optifine fixes mainly focus on properly handling the shadow pass when shaders are enabled. Additionally, a "stub" jar for optifine was pulled in as a maven dependency, which only contains the shadersmod part (which in itself is open source and thus not limited by the optifine redistribution license). This removed multiple reflection calls that caused microstutter.

Minor changes

More aggressive GC

The vram garbage collector is now slightly more aggressive. The dynamic vram allocator also contains more efficient vram management logic, so this could be implemented with zero extra performance hit.

Much faster vram visualizer

Exactly what it says on the tin, the vram visualizer is now only a single tessellator draw call, instead of one per pixel.

Fixed git version retrieving

git describe can do the same thing that get_version.py was doing, without making the repo depend on python.

Toggleable update checker

Config option for disabling the update checker. Good for modpacks.

Driver jankiness workarounds

The GC doesn't kick in for 25 frames after doing F3+A. For some reason, on Windows + NVIDIA, the GC caused the game to violently stutter right after a renderer reload.

Updated the repo to use the latest LWJGL2 build in dev

This is the default lwjgl2 version used by virtually all launchers nowadays.