Skip to content

Features

Zaldaryon edited this page Jul 28, 2026 · 17 revisions

Features

Every optimization that ships in Optimum v0.3.3. Each one produces identical gameplay to vanilla. The only observable difference is higher and steadier FPS.

Optimum patches copies of your game's assemblies at launch. An optimization reaches the game only when a Cecil target, an API rule, or a runtime donor manifest owns it: the full inventory, including source patches that do not currently ship, is in docs/patch-shipping-audit-0.3.0.md.

FSR 1.0 Upscaling

FidelityFX Super Resolution 1.0. Optimum ships AMD's FSR 1.0 EASU + RCAS shader pipeline. The Render Scale (FSR) dropdown in the Extra settings tab offers Native (1.0x), Quality (0.85x), Balanced (0.77x) and Performance (0.67x). Below native, the scene renders at the reduced resolution, EASU upscales it with edge-adaptive filtering, and RCAS applies contrast-adaptive sharpening. Lower scales trade some softness for fill-rate. Changing the setting rebuilds the framebuffers and reloads shaders live. Native bypasses the pipeline entirely and, since 0.3.0, also skips the LOD-bias sampler calls, so native output matches vanilla exactly.

Map

Map Page Cache. Vanilla's ChunkMapLayer uploads and draws map terrain per map chunk. Optimum groups chunks into 8x8 pages (256x256 pixels), persists them as GZip-compressed RGBA under ModData/optimum-map/{world-id}/ via a background coalescing writer, uploads them into a 128-layer GL_TEXTURE_2D_ARRAY with LRU eviction, and draws the whole visible set in one DrawArraysInstanced call against the optimum-map shader. Pages compress to BC7 Mode 6 (64KB instead of 256KB) when the GPU exposes GL_ARB_texture_compression_bptc. 2x and 4x box-filtered LOD tiers serve zoomed-out views, and a squared-distance priority queue loads pages nearest the viewport first. Falls back to the vanilla per-component path when no pages are resident.

Map Terrain Pre-generation (opt-in). With MapPageCachePregen set to true in .optimum/optimum.json, unexplored chunks entering the viewport receive approximate biome colour derived from the world seed plus the climate, ocean and forest maps the client already receives, shaded by replaying GenTerra's terrain noise (9 octaves, freq 1/3267, persistence 0.9) over a 34x34 padded height grid for NW-illuminated slope brightness. Pregen pixels are desaturated 35% so they read as distinct from explored terrain, and real explored data always takes priority. Runs on the background map thread; zero main-thread cost. Default off.

Frame Timing

Precise Frame Pacing. Vanilla uses Thread.Sleep(1) for frame limiting, which overshoots by 1-15ms depending on the OS timer resolution. Optimum replaces this with a three-stage loop: sleep while far from target, yield when close, spin for the final microseconds. Frame times become consistent and micro-stutter disappears. Togglable in settings.

Background FPS Limiter. When the game window loses focus (alt-tab), Optimum caps the client at 30 FPS. The GPU and CPU drop to near-idle. Togglable in settings.

Rendering

Entity Shadow Distance Culling. Shadows for entities beyond a configurable distance (default 80 blocks) stop drawing. Shadow maps are expensive per-entity, and shadows beyond this range are invisible to the player. The distance slider in settings controls the threshold.

Shadow Far Vegetation Skip. The far shadow cascade renders vegetation (BlendNoCull pass) into a shadow map that covers terrain at extreme range. At that distance, foliage shadows contribute nothing visible. Optimum skips vegetation in the far cascade. Togglable in settings.

Dynamic Light Radius Scaling. The held-item dynamic light (torch, lantern) uses a fixed 120-block radius in vanilla. Optimum scales it to 35-60 blocks based on your view distance setting. A 120-block light sphere on a 64-block view distance wastes GPU time illuminating chunks that do not exist on screen.

Chiseled Block LOD. Chiseled blocks carry full vertex meshes (up to 15,000 vertices per block for complex sculptures). Optimum uses the engine's native lodLevel system to render distant chiseled blocks as simplified geometry. Near blocks render at full detail. Far blocks drop to a solid cube. 83x vertex reduction for distant chiseled chunks in builds with heavy microblock use. Togglable in settings.

Entity Render Distance Pre-Cull. Before computing the model matrix, shader uniforms, and UBO joint copy for an entity, Optimum checks squared distance against view distance. Entities beyond range skip the render call entirely. At 200 loaded entities, this saves 6-15 microseconds per frame in the opaque render pass.

Entity Light Batch. Vanilla resolves chunk light levels per entity, per frame, acquiring a lock and allocating each time. Optimum collects sample coordinates from all visible entity renderers after each frame, groups them by chunk, and resolves them in a single batched pass under one lock acquisition per chunk segment. Zero per-frame allocation. 42-67% CPU reduction for the light lookup path at 32-512 entities.

Shader State Cache. Vanilla uploads viewMatrix and waterWaveCounter to the GPU and resolves the Animation UBO for every entity, every frame. Optimum uploads once per render pass and exposes the cached state through client API. Each renderer reads the cache when shader and pass match. 83% reduction in uniform upload and UBO lookup cost at 32+ entities.

Smart Chunk Culling. Vanilla only enables occlusion culling once 100+ chunks are loaded, so it never helps at low view distances. Optimum scales that threshold with your view distance instead. No visual difference. Togglable in settings.

Dynamic Light Scan Reuse. Every frame, vanilla scans nearby entities for dynamic light sources (held torches, glowing creatures). While the player stands still, Optimum reuses the previous frame's scan; it refreshes as soon as the player moves, and at most every 15 frames, so a new light still appears within a quarter of a second. Togglable in settings.

Trader/Villager Re-tesselation Stutter Fix (opt-in). Dressed NPCs re-tesselating their shape and gear (a caravan arriving, entering a village) could cost 50-230ms in a single frame. Three settings target this, configurable only via ModConfig/optimum.json (no in-game toggle yet), all default OFF pending broader testing:

  • EntityTesselationFrameBudget caps how many dressed-entity re-tesselations run per frame, spreading the rest across following frames instead of front-loading them all at once.
  • EntityOutfitShapeCache reuses the fully assembled gear shape and resolved textures for an outfit combination already built once, instead of re-parsing every gear piece's shape JSON and re-walking the step-parenting element tree per entity.
  • EntityOutfitAnimatorCache reuses the built animator (pose graph) for entities sharing the same outfit combination instead of rebuilding it from scratch on every re-tesselation - the largest remaining cost in this path, mirroring vanilla's own AnimationCache but keyed to also include the outfit (vanilla's cache key can't tell outfits apart).
  • EntityOutfitTexturePrewarm inserts every outfit variant's textures into the atlas once during the loading screen instead of on first encounter mid-gameplay, where a texture atlas cache miss can cost 100ms+ in a single frame.

Together, measured via .optimum stutterwatch, these reduced per-call cost from 58-230ms down to 7-9ms in real gameplay testing.

Name-Tag Frustum Reuse. Vanilla runs a frustum visibility check per HUD element per entity (name tag, health bar, debug info). Optimum reuses the entity.IsRendered flag set during the render pass instead of recomputing SphereInFrustum per entity per frame.

Water Foam Grid Reduction. Foam edge detection on water and lava surfaces uses a depth comparison grid. Vanilla samples a 5x5 area (25 depth reads per water fragment). Optimum shrinks this to 3x3 (9 reads). The foam edge is slightly sharper but visually indistinguishable in motion. In scenes with significant water coverage (ocean biomes, rivers), this saves millions of texture reads per frame.

Entity and Physics

Repulsion Distance Gate. Client-side entity repulsion physics (the force that prevents entities from overlapping) skips entities beyond a configurable range (default 64 blocks). Repulsion at that distance has zero visual impact because the entities are too small to see overlap. The distance slider in settings controls the threshold. Togglable.

Animation Check Reorder. Vanilla tests frustum visibility before testing distance for entity animation updates. Frustum intersection is more expensive than a distance squared comparison. Optimum reverses the order: test distance first, skip the frustum check if the entity is already too far. The result is identical (same entities get animated), the cost is lower.

Audio and Weather

Weather Wind Throttle. Wind calculations (used for grass/leaf sway, particle drift, ambient audio panning) run every frame in vanilla. Optimum caches the result and reuses it for 4 frames. Wind changes slowly enough that a 66ms stale value is imperceptible. Togglable in settings.

Particle Distance Gate. Particle emitters beyond 48 blocks stop spawning. At that range, individual particles are sub-pixel and invisible. Reduces CPU and GPU load in chunk-dense areas with many forges, campfires, and torches. Togglable in settings.

Ambient Sound Position Gate. When the player stands still, ambient sound source positions do not change. Vanilla recalculates them every frame regardless. Optimum skips the update when the player position delta is zero.

Fly Sound Volume Deduplication. The flight/glide sound adjusts volume based on velocity. Vanilla pushes a new volume value to the audio engine every frame. Optimum skips the update when the delta is below 1%. The audio engine cannot reproduce sub-1% volume differences through speakers.

Memory and GC

BlockPos Reuse in Particle Ticks. Ticking blocks spawn particles in a loop. Vanilla allocates a new BlockPos struct per particle per tick. Optimum reuses a single BlockPos instance across the loop, zeroing GC pressure from this path.

Lock Contention Reduction. Ten high-contention locks in the render path (Monitor.Enter/Exit pairs on shared chunk, entity, and mesh data) now use System.Threading.Lock (the .NET 9+ lightweight lock). The new lock skips kernel transitions under low contention and reduces spin counts. Measurable on machines with 8+ threads where render and mesh-build threads compete for the same chunk segment locks.

Mat4f.Multiply Inlining. Thirteen hot 4x4 matrix methods (Multiply, Translate, Scale, Rotate, etc.) carry [MethodImpl(AggressiveInlining)]. These methods run 50,000+ times per frame during entity rendering and mesh transforms. The inlining hint eliminates call/ret overhead and enables the JIT to fold the multiplication into the caller.

Shader Optimizations

Optimum ships modified GLSL shaders in assets/game/shaders/. These replace the vanilla shaders at deploy time. They produce identical visual output to vanilla (or output within rounding error) and have no runtime toggle.

  • godrays.fsh: sample count capped by quality level
  • chunkshadowmap.fsh: alpha discard threshold raised from 0.02 to 0.15
  • cloudvolumetric.fsh: march steps capped at 100 (vanilla: 200)
  • chunkliquid.fsh: 3x3 foam grid (vanilla: 5x5)

Version 0.2.4 shipped SSAO and bloom blur shaders (bilateralblur, blur) that darkened the scene. Version 0.2.5 removed them.

Bugfixes

#9710: Mouse Wheel at Low Sensitivity. Vanilla casts the high-precision wheel delta to int before applying sensitivity. At sensitivity values below 1.0, the int truncation creates dead zones where scrolling does nothing. Optimum keeps the float precision through the full calculation chain.

Background FPS Focus Debounce. The background FPS limiter fired during world load when the window flickered focus state. Optimum adds a 300ms debounce before clamping to the background cap, preventing false triggers during loading screens and rapid alt-tab sequences.

Frame Pacing Timer Resolution. The spin-loop tail used unconditional busy-spin on all hardware. On machines with 5 or fewer cores, this starved other threads. Optimum gates the spin tail behind Environment.ProcessorCount > 5 and calls timeBeginPeriod(1) on Windows for 1ms sleep resolution.

VS Roofing LOD Fix. Roof blocks from VS Roofing 1.6.3 use BlockEntityMicroBlock but set canChisel = false. The chisel LOD gate checked canChisel with a default of true, replacing roof meshes with cubes. Optimum reads the attribute and skips LOD substitution when false.

Linux Font Rendering. Optimum recompiled cairo-sharp.dll from source, producing different codegen than Anego's build. Glyph shapes (the "pointy g" report) differed on Linux. Optimum now ships vanilla's pristine cairo-sharp.dll and .pdb without modification.

SVG Asset Reload. Mods that hold IAsset references from GetMany(loadAsset: false) and draw them after OnAllAssetsLoadedAndClientJoined unloads the textures category (waypoint icon packs drawing wp* CustomIcons) crash with ArgumentNullException in vanilla. Optimum reloads the asset from its Origin before the throw path, keeping icons drawing at the cost of a few KB per SVG. If the reload fails, the vanilla throw still fires.

Chiseled Block Shadow LOD. The distant full-cube chisel proxy was reaching the shadow depth map at any range, so chiseled blocks cast full-block shadows even right next to the camera, and the frustum bridge returned one visibility answer for both chisel LOD levels — drawing both meshes at once up close and neither past the threshold. Fixed in 0.3.0 with a dedicated shadow-pass hook and per-LOD branching.

#9718: Crucible Black Above 900°C. CrucibleInFirepitRenderer added incandescence colour into RgbaLightIn, saturating the light vector past 1.0, which some Nvidia drivers render as black. Glow now goes through the dedicated RgbaGlowIn uniform, matching the forge renderer.

Prospecting Pick Node Search Silently Failing. Node Search Mode never printed "no ore nearby" or any quantity result (Density Search Mode still worked). Two fields added for the node-search optimization had no initializer run under the runtime patcher, so the first lookup threw before any chat message could be sent. Fixed by lazily initializing on first use.

Animation Lookup Allocation. Every animated entity's animation-state lookup lowercased its animation code on every call instead of using a case-insensitive dictionary comparer - a string allocation per lookup, per entity, per frame. Fixed at the API level.

Creative Search Cache Crash Containment. The creative inventory search caches results in a dictionary keyed by search string. A mod that registers a collectible with a null code causes a NullReferenceException during cache population, which vanilla propagates to the render thread and crashes the client. Optimum wraps the cache build in a try-catch, logs the offending mod's assembly name, and falls back to an empty result set. The search returns no matches for that query instead of killing the session.

Clone this wiki locally