Skip to content

Commit

Permalink
partially fix paper rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Jab125 committed Nov 30, 2023
1 parent 6785c0a commit c39d5fd
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ultreon.devices.programs;

import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.platform.NativeImage;
import com.mojang.blaze3d.platform.TextureUtil;
import com.mojang.blaze3d.systems.RenderSystem;
Expand Down Expand Up @@ -522,6 +523,12 @@ public boolean render(PoseStack pose, CompoundTag data) {

int textureId = TextureUtil.generateTextureId();
TextureUtil.prepareImage(textureId, resolution, resolution);
if (!RenderSystem.isOnRenderThreadOrInit()) {
RenderSystem.recordRenderCall(() -> GlStateManager._bindTexture(textureId));
} else {
GlStateManager._bindTexture(textureId);
}
image.upload(0, 0, 0, false);

RenderSystem.setShaderTexture(0, textureId);
RenderUtil.drawRectWithTexture(null, pose, -1, 0, 0, 0, 1, 1, resolution, resolution, resolution, resolution);
Expand Down

0 comments on commit c39d5fd

Please sign in to comment.