Skip to content

Commit

Permalink
Fixed hand with lights
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocelot5836 committed Jan 11, 2025
1 parent 52e527d commit a32e20f
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import foundry.veil.api.client.render.framebuffer.VeilFramebuffers;
import foundry.veil.api.client.render.post.PostPipeline;
import foundry.veil.api.client.render.post.PostProcessingManager;
import foundry.veil.ext.RenderTargetExtension;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.ResourceLocation;
import org.jetbrains.annotations.ApiStatus;

Expand Down Expand Up @@ -39,13 +41,15 @@ public static void bind(int mask) {
VeilRenderSystem.renderer().getFramebufferManager().setFramebuffer(VeilFramebuffers.FIRST_PERSON, firstPerson);
firstPerson.bind(false);
firstPerson.clear(mask);
enabled = true;
// This redirects calls to the vanilla framebuffer to the first person buffer instead
((RenderTargetExtension) Minecraft.getInstance().getMainRenderTarget()).veil$setWrapper(firstPerson);
}

public static void unbind() {
((RenderTargetExtension) Minecraft.getInstance().getMainRenderTarget()).veil$setWrapper(null);

VeilRenderer renderer = VeilRenderSystem.renderer();
PostProcessingManager postProcessingManager = renderer.getPostProcessingManager();
enabled = false;

PostPipeline pipeline = postProcessingManager.getPipeline(FIRST_PERSON);
if (pipeline == null) {
Expand All @@ -57,9 +61,7 @@ public static void unbind() {
postProcessingManager.runPipeline(pipeline, false);
}

if (!renderer.getDynamicBufferManger().clearRenderState(true)) {
AdvancedFbo.unbind();
}
AdvancedFbo.unbind();
}

public static void free() {
Expand Down

0 comments on commit a32e20f

Please sign in to comment.