From a5351a73f09a17fcce2ec31dce326d76cba6ee02 Mon Sep 17 00:00:00 2001 From: DJtheRedstoner <52044242+DJtheRedstoner@users.noreply.github.com> Date: Thu, 5 Dec 2024 02:52:46 -0500 Subject: [PATCH] ReleasedDynamicTexture: Fix texture filters on 1.21.4+ As of 1.21.4, NativeImage#upload no longer sets the texture filter to GL_NEAREST, which is the default filter for ReleasedDynamicTexture. Setting it manually ensures that ReleasedDynamicTexture behaves the same as on previous versions. Linear: EM-3015 GitHub: #87 --- .../gg/essential/universal/utils/ReleasedDynamicTexture.kt | 4 ++++ versions/1.17.1-1.16.2.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/src/main/kotlin/gg/essential/universal/utils/ReleasedDynamicTexture.kt b/src/main/kotlin/gg/essential/universal/utils/ReleasedDynamicTexture.kt index b285bb5..8912738 100644 --- a/src/main/kotlin/gg/essential/universal/utils/ReleasedDynamicTexture.kt +++ b/src/main/kotlin/gg/essential/universal/utils/ReleasedDynamicTexture.kt @@ -15,7 +15,9 @@ import net.minecraft.client.resources.IResourceManager //#if MC<11502 || STANDALONE import java.awt.image.BufferedImage //#else +//$$ import com.mojang.blaze3d.platform.GlStateManager //$$ import net.minecraft.client.renderer.texture.NativeImage +//$$ import org.lwjgl.opengl.GL11 //#endif @@ -110,6 +112,8 @@ class ReleasedDynamicTexture private constructor( //#if MC>=11400 //$$ UGraphics.configureTexture(allocGlId()) { //$$ textureData?.uploadTextureSub(0, 0, 0, false) + //$$ GlStateManager.texParameter(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST) + //$$ GlStateManager.texParameter(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST) //$$ } //$$ textureData = null //#else diff --git a/versions/1.17.1-1.16.2.txt b/versions/1.17.1-1.16.2.txt index 05387a9..ba35df1 100644 --- a/versions/1.17.1-1.16.2.txt +++ b/versions/1.17.1-1.16.2.txt @@ -11,4 +11,5 @@ com.mojang.blaze3d.platform.GlStateManager glAttachShader() attachShader() com.mojang.blaze3d.platform.GlStateManager glLinkProgram() linkProgram() com.mojang.blaze3d.platform.GlStateManager glGetProgrami() getProgram() com.mojang.blaze3d.platform.GlStateManager glGetProgramInfoLog() getProgramInfoLog() +com.mojang.blaze3d.platform.GlStateManager _texParameter() texParameter() com.mojang.blaze3d.systems.RenderSystem setShaderColor() color4f()