Skip to content

Commit

Permalink
ReleasedDynamicTexture: Fix texture filters on 1.21.4+
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DJtheRedstoner authored Dec 5, 2024
1 parent a8a1f2b commit a5351a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions versions/1.17.1-1.16.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit a5351a7

Please sign in to comment.