Skip to content

Commit a5351a7

Browse files
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
1 parent a8a1f2b commit a5351a7

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/main/kotlin/gg/essential/universal/utils/ReleasedDynamicTexture.kt

+4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import net.minecraft.client.resources.IResourceManager
1515
//#if MC<11502 || STANDALONE
1616
import java.awt.image.BufferedImage
1717
//#else
18+
//$$ import com.mojang.blaze3d.platform.GlStateManager
1819
//$$ import net.minecraft.client.renderer.texture.NativeImage
20+
//$$ import org.lwjgl.opengl.GL11
1921
//#endif
2022

2123

@@ -110,6 +112,8 @@ class ReleasedDynamicTexture private constructor(
110112
//#if MC>=11400
111113
//$$ UGraphics.configureTexture(allocGlId()) {
112114
//$$ textureData?.uploadTextureSub(0, 0, 0, false)
115+
//$$ GlStateManager.texParameter(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST)
116+
//$$ GlStateManager.texParameter(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST)
113117
//$$ }
114118
//$$ textureData = null
115119
//#else

versions/1.17.1-1.16.2.txt

+1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ com.mojang.blaze3d.platform.GlStateManager glAttachShader() attachShader()
1111
com.mojang.blaze3d.platform.GlStateManager glLinkProgram() linkProgram()
1212
com.mojang.blaze3d.platform.GlStateManager glGetProgrami() getProgram()
1313
com.mojang.blaze3d.platform.GlStateManager glGetProgramInfoLog() getProgramInfoLog()
14+
com.mojang.blaze3d.platform.GlStateManager _texParameter() texParameter()
1415
com.mojang.blaze3d.systems.RenderSystem setShaderColor() color4f()

0 commit comments

Comments
 (0)