Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ public void runBloomDraws(Matrix4fc modelViewMatrix, FeatureRenderDispatcher fea

@SuppressWarnings("DataFlowIssue")
public void process() {
if (!dirty) return;
CommandEncoder commandEncoder = device.createCommandEncoder();

transformsUbo.upload(commandEncoder, transformUBO.slice());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package dev.anvilcraft.lib.v2.rendering.mixins;

import dev.anvilcraft.lib.v2.rendering.ALRPostEffects;
import dev.anvilcraft.lib.v2.rendering.bloom.BloomPostEffect;
import net.minecraft.client.renderer.GameRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(GameRenderer.class)
public class GameRendererMixin {

@Inject(
method = "resize",
at = @At("HEAD")
)
void onResize(int width, int height, CallbackInfo ci) {
BloomPostEffect bloomPostEffect = ALRPostEffects.getBloomPostEffect();
if (bloomPostEffect != null) {
bloomPostEffect.resize(
width,
height
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ private void onCreateInstance(GameConfig gameConfig, CallbackInfo ci) {
ALRPostEffects.createPostEffects();
}

@Inject(
method = "resizeGui",
at = @At("RETURN")
)
private void onResizeGui(CallbackInfo ci) {
BloomPostEffect bloomPostEffect = ALRPostEffects.getBloomPostEffect();
if (bloomPostEffect != null) {
bloomPostEffect.resize(
this.window.getWidth(),
this.window.getHeight()
);
}
}
// @Inject(
// method = "resizeGui",
// at = @At("RETURN")
// )
// private void onResizeGui(CallbackInfo ci) {
// BloomPostEffect bloomPostEffect = ALRPostEffects.getBloomPostEffect();
// if (bloomPostEffect != null) {
// bloomPostEffect.resize(
// this.window.getWidth(),
// this.window.getHeight()
// );
// }
// }

@Inject(
method = "updateLevelInEngines(Lnet/minecraft/client/multiplayer/ClientLevel;Z)V",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
"mixins": [
],
"client": [
"GameRendererMixin",
"GuiGraphicsExtractorMixin",
"ItemStackRenderStateMixin",
"GuiRendererMixin",
"ItemStackRenderStateMixin",
"MinecraftMixin",
"RenderTypeMixin"
],
Expand Down
Loading