SlashBlade:A Belated Gift

Quick rating

SlashBlade:A Belated Gift

No reviews yet

SlashBlade Rendering Refactor & Optimization — for every SlashBlade enthusiast!

Bug Fixes
Performance & Optimization
Mod Loaders
Forge
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

About

Project Details

Type
Mod
Latest Version
a_belated_gift-1.0.1.jar
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID

Resources

External Links

Source Issues Wiki Discord

About

Description

A Belated Gift — SlashBlade Rendering Optimization Mod

📖 What Is This?

This is a client-side rendering optimization mod for SlashBlade: Resharped, designed to eliminate severe FPS drops when holding a blade, swinging, rendering dropped blades, using shaders, or loading YSM models.

In one sentence: holding FPS doubles, swinging triples, and dropped high-poly blades get a 30x boost.


📊 Performance Comparison

Test Configuration: AMD Ryzen 7 9700X + NVIDIA RTX 5070 Ti

Second-person perspective, BSL shaders, Blade: Alchemy Kingdom

Without Shaders

Scenario Vanilla Accelerated Render A Belated Gift Improvement (vs Vanilla)
Holding Blade 359 412 810 +126%
Swinging 220 248 620 +182%
17 High-Poly Dropped Blades 61 425 730 +1097%

With Shaders (BSL)

Scenario Vanilla Accelerated Render A Belated Gift Improvement (vs Vanilla)
Holding Blade 208 330 355 +71%
Swinging 115 153 340 +196%
17 High-Poly Dropped Blades 29 240 293 +910%

YSM Compatibility

Scenario Vanilla Accelerated Render A Belated Gift Improvement (vs Vanilla)
No Shaders · Holding 374 398 724 +94%
No Shaders · Swinging 208 362 605 +191%
Shaders · Holding 215 301 341 +59%
Shaders · Swinging 172 261 333 +94%

⚙️ How Does It Work?

No More "Redraw Every Frame"

Vanilla rendering traverses every group, face, and vertex of the OBJ model on each frame. This mod "bakes" the data into a GPU-friendly format at load time, then simply reuses it every frame thereafter.

Static VBO Caching

Blade bodies, sheaths, item icons, blades on stands, and dropped blades all share a 96 MiB LRU cache. The second time the same blade appears, it reuses the data already uploaded to VRAM instead of resubmitting vertices.

Enchantment glints also get their own dedicated static cache, so they no longer drag down performance.

"Smart Savings" Under Shaders

  • Uses a simplified 32-segment proxy mesh instead of the full high-poly model during shadow rendering
  • Transparent effects (SlashEffects, Judgement Cut, etc.) skip the shadow map stage entirely
  • Glowing blade bodies do not cast shadows repeatedly

Swing Animation — "Only What's Necessary"

Vanilla calculates full PMD vertex skinning for every swing, even though only two bone anchor points are actually used. This mod skips the useless vertex calculations and keeps only the bone poses.

LOD for Blade Effects

Full detail at close range, fewer layers at medium range, and only the core body at long range — with further simplification under shaders.

No First-Use Stutter

Models, textures, and RenderTypes are pre-warmed before you even enter the game. No sudden stutter when swinging a blade or opening your inventory for the first time.

Automatic Cache Cleanup

Caches are automatically cleared when you exit a world or reload resources — performance stays consistent over time.

Compatibility & Safe Fallback

Retains the RenderOverrideEvent. If dynamic UVs, dynamic transparency, or uncacheable meshes are detected, it automatically falls back to vanilla rendering — no crashes.


⚠️ Incompatibility

Not compatible with [Accelerated Render] — both mods overlap in functionality. Installing them together may cause rendering glitches or performance degradation.


Slash Effect Rendering API

This API is intended for SlashBlade addons that need to replace the slash effect model or texture. The addon only selects the resources, while A Belated Gift continues to handle distance-based LOD, shader compatibility, mesh optimization, and resource warm-up.

After adopting this API, an addon must not use a Mixin to cancel SlashEffectRenderer.render. Cancelling that method prevents the registry from being reached.

Replacing Only the Slash Texture

Register the rule from an enqueued FMLClientSetupEvent task:

import cn.star.a_belated_gift.api.client.SlashEffectRenderRegistry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;

private static final ResourceLocation RULE_ID =
        new ResourceLocation("example", "special_blade_slash");
private static final ResourceLocation SLASH_TEXTURE =
        new ResourceLocation("example", "model/util/special_slash.png");

private static void onClientSetup(FMLClientSetupEvent event) {
    event.enqueueWork(() -> SlashEffectRenderRegistry.registerTexture(
            RULE_ID,
            100,
            effect -> effect.getOwner() instanceof Player player
                    && player.getMainHandItem().is(EXAMPLE_BLADE.get()),
            SLASH_TEXTURE
    ));
}

registerTexture continues to use SlashBlade's default model/util/slash.obj model.

Replacing Both the OBJ and Texture

import cn.star.a_belated_gift.api.client.SlashEffectRenderDefinition;
import cn.star.a_belated_gift.api.client.SlashEffectRenderRegistry;

private static final SlashEffectRenderDefinition SPECIAL_SLASH =
        new SlashEffectRenderDefinition(
                new ResourceLocation("example", "model/util/special_slash.obj"),
                new ResourceLocation("example", "model/util/special_slash.png")
        );

private static void onClientSetup(FMLClientSetupEvent event) {
    event.enqueueWork(() -> SlashEffectRenderRegistry.register(
            new ResourceLocation("example", "special_blade_slash"),
            100,
            effect -> effect.getOwner() instanceof Player player
                    && player.getMainHandItem().is(EXAMPLE_BLADE.get()),
            SPECIAL_SLASH
    ));
}

This register overload automatically adds the definition's OBJ and texture to the warm-up list.

Dynamic Providers

Implement SlashEffectRenderProvider when the definition must be selected dynamically from the effect state:

import cn.star.a_belated_gift.api.client.SlashEffectRenderDefinition;
import cn.star.a_belated_gift.api.client.SlashEffectRenderProvider;
import mods.flammpfeil.slashblade.entity.EntitySlashEffect;

import java.util.Collection;
import java.util.List;

public final class ExampleSlashProvider implements SlashEffectRenderProvider {
    private static final SlashEffectRenderDefinition BLUE =
            SlashEffectRenderDefinition.withTexture(
                    new ResourceLocation("example", "model/util/blue_slash.png"));
    private static final SlashEffectRenderDefinition RED =
            SlashEffectRenderDefinition.withTexture(
                    new ResourceLocation("example", "model/util/red_slash.png"));

    @Override
    public SlashEffectRenderDefinition resolve(EntitySlashEffect effect) {
        if (!(effect.getOwner() instanceof Player player)
                || !player.getMainHandItem().is(EXAMPLE_BLADE.get())) {
            return null;
        }
        return effect.getIsCritical() ? RED : BLUE;
    }

    @Override
    public Collection<SlashEffectRenderDefinition> warmupDefinitions() {
        return List.of(BLUE, RED);
    }
}
event.enqueueWork(() -> SlashEffectRenderRegistry.register(
        new ResourceLocation("example", "dynamic_slash"),
        200,
        new ExampleSlashProvider()
));

Returning null from resolve means that the current rule does not match. The registry then checks the next provider. Every resource that may be returned should be declared through warmupDefinitions.

Matching Order

  • Rules with a higher numeric priority are evaluated first.
  • Rules with the same priority are ordered by registration ID, making the result independent of mod loading order.
  • The first provider that returns a non-null definition wins.
  • SlashBlade's default model and texture are used when no rule matches.
  • Registering the same ID again replaces the previous rule.
  • Provider exceptions are isolated and logged, allowing the remaining rules to continue matching.

Unregistering a Rule

boolean removed = SlashEffectRenderRegistry.unregister(
        new ResourceLocation("example", "special_blade_slash")
);

Unregistering only affects subsequent slash effect selection. Resources that have already been warmed are managed by Minecraft's resource lifecycle.

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
Created
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works