Added ability to change vanilla's lod bias
This commit is contained in:
+1
-1
Submodule coreSubProjects updated: 49b345776f...e695c18871
@@ -0,0 +1,27 @@
|
||||
package com.seibel.lod.fabric.mixins.client;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.platform.TextureUtil;
|
||||
import com.seibel.lod.core.config.Config;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
/**
|
||||
* Sets Minecraft's LOD Bias (looks similar to mipmaps)
|
||||
*
|
||||
* @author coolGi
|
||||
*/
|
||||
@Mixin(TextureUtil.class)
|
||||
public class MixinTextureUtil {
|
||||
@Redirect(method = "Lcom/mojang/blaze3d/platform/TextureUtil;prepareImage(Lcom/mojang/blaze3d/platform/NativeImage$InternalGlFormat;IIII)V",
|
||||
at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/GlStateManager;_texParameter(IIF)V"))
|
||||
private static void setLodBias(int target, int pname, float param) {
|
||||
float biasValue = Config.Client.Graphics.AdvancedGraphics.lodBias.get().floatValue();
|
||||
if (biasValue != 0) {
|
||||
// The target is GL11.GL_TEXTURE_2D
|
||||
// And the pname is GL14.GL_TEXTURE_LOD_BIAS
|
||||
GlStateManager._texParameter(target, pname, biasValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
"client.MixinLightmap",
|
||||
"client.MixinOptionsScreen",
|
||||
"client.MixinMinecraft",
|
||||
"client.MixinTextureUtil",
|
||||
"mods.sodium.MixinSodiumChunkRenderer"
|
||||
],
|
||||
"injectors": {
|
||||
|
||||
Reference in New Issue
Block a user