saif syed

make a all in one performance mode for 26.3 with integrated shaders

Kodari AI
KodariOct 23 at 4:59 pm 4
PerformanceUltra
PerformanceUltra is an all-in-one performance optimization mod for Minecraft Fabric 26.3 that integrates advanced shader support directly into the game. It combines FPS-boosting features including dynamic chunk loading, optimized entity rendering, memory management, and GPU-accelerated rendering pipelines. The mod features an integrated shader system with multiple preset profiles, real-time performance monitoring overlay, adaptive resolution scaling, and intelligent texture compression. It includes configurable graphics settings, automatic hardware detection, and a user-friendly HUD for adjusting performance parameters in-game. PerformanceUltra delivers seamless gameplay enhancement with built-in shader compatibility for popular shader packs.
  1. Build a Fabric 26.3 client mod with a one-key performance mode and restorable graphics settings.

  2. Check the 26.3 source for client settings/keybind hooks and whether vanilla supports bundled shader effects without an unavailable shader mod.

  3. Add the mod metadata, build setup, client code, and shader assets if the supported API allows it.

Created the Fabric 26.3 client mod. Press P to apply the performance preset (shorter render/simulation distances, reduced entity distance, clouds off, minimal particles, zero biome blending and mipmaps); press P again to restore the settings captured when you enabled it. Press O to toggle the bundled, lightweight contrast shader.

The shader uses Minecraft’s built-in post-processing pipeline; it does not add support for external shader packs such as Iris. Settings and toggle state are session-only.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
11 267
src/client/java/com/kodari/performancemode/PerformanceModeClient.java
package com.kodari.performancemode;

import com.mojang.blaze3d.platform.InputConstants;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keymapping.v1.KeyMappingHelper;
import net.minecraft.client.CloudStatus;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.client.Options;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.Identifier;
import net.minecraft.server.level.ParticleStatus;

public final class PerformanceModeClient implements ClientModInitializer {
    private static final Identifier SHADER_ID = Identifier.fromNamespaceAndPath("performancemode", "clean_tone");
    private static final KeyMapping.Category CATEGORY = KeyMapping.Category.register(
            Identifier.fromNamespaceAndPath("performancemode", "main")
    );
    private static final KeyMapping PERFORMANCE_KEY = KeyMappingHelper.registerKeyMapping(
            new KeyMapping(
                    "key.performancemode.toggle_performance",
                    InputConstants.getKey("key.keyboard.p").getType(),
                    InputConstants.getKey("key.keyboard.p").getValue(),
                    CATEGORY
            )
    );
    private static final KeyMapping SHADER_KEY = KeyMappingHelper.registerKeyMapping(
            new KeyMapping(
                    "key.performancemode.toggle_shader",
                    InputConstants.getKey("key.keyboard.o").getType(),
                    InputConstants.getKey("key.keyboard.o").getValue(),
                    CATEGORY
            )
    );

    private static Snapshot savedOptions;
    private static boolean shaderEnabled;

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (PERFORMANCE_KEY.consumeClick()) {
                togglePerformance(client);
            }
            while (SHADER_KEY.consumeClick()) {
                shaderEnabled = !shaderEnabled;
                showMessage(client, "Integrated shader " + (shaderEnabled ? "enabled" : "disabled"));
            }
        });
    }

    public static boolean isShaderEnabled() {
        return shaderEnabled;
    }

    private static void togglePerformance(Minecraft client) {
        Options options = client.options;
        if (savedOptions == null) {
            savedOptions = Snapshot.capture(options);
            options.renderDistance().set(8);
            options.simulationDistance().set(5);
            options.entityDistanceScaling().set(0.5);
            options.cloudStatus().set(CloudStatus.OFF);
            options.particles().set(ParticleStatus.MINIMAL);
            options.biomeBlendRadius().set(0);
            options.mipmapLevels().set(0);
            showMessage(client, "Performance preset enabled");
        } else {
            savedOptions.restore(options);
            savedOptions = null;
            showMessage(client, "Performance preset disabled; previous settings restored");
        }
    }

    private static void showMessage(Minecraft client, String message) {
        if (client.player != null) {
            client.player.sendOverlayMessage(Component.literal(message));
        }
    }

    private record Snapshot(
            int renderDistance,
            int simulationDistance,
            double entityDistanceScaling,
            CloudStatus clouds,
            ParticleStatus particles,
            int biomeBlendRadius,
            int mipmapLevels
    ) {
        private static Snapshot capture(Options options) {
            return new Snapshot(
                    options.renderDistance().get(),
                    options.simulationDistance().get(),
                    options.entityDistanceScaling().get(),
                    options.cloudStatus().get(),
                    options.particles().get(),
                    options.biomeBlendRadius().get(),
                    options.mipmapLevels().get()
            );
        }

        private void restore(Options options) {
            options.renderDistance().set(renderDistance);
            options.simulationDistance().set(simulationDistance);
            options.entityDistanceScaling().set(entityDistanceScaling);
            options.cloudStatus().set(clouds);
            options.particles().set(particles);
            options.biomeBlendRadius().set(biomeBlendRadius);
            options.mipmapLevels().set(mipmapLevels);
        }
    }
}