Nuked the old removeLegacyFog due to it failing on Sodium

This commit is contained in:
tom lee
2022-01-13 22:24:39 +08:00
parent bb22ad58bc
commit 976874e7a3
3 changed files with 4 additions and 36 deletions
@@ -440,32 +440,4 @@ public class GLProxy
instance.workerThread = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat(GLProxy.class.getSimpleName() + "-Worker-Thread").build());
}
}
/**
* If called from a legacy OpenGL context this will
* set the fog end to infinity with a density of 0.
* Effectively removing the fog.
* <p>
* This only works with Legacy OpenGL because James hasn't
* looking into a way for it to work with Modern OpenGL.
*/
public boolean disableLegacyFog()
{
// make sure this is a legacy OpenGL context
if (minecraftGlCapabilities.glFogf != 0)
{
// glFogf should only have an address if the current OpenGL
// context can call it, and it should only be able to call it in
// legacy OpenGL contexts; since it is disabled in Modern
// OpenGL.
GL11.glFogf(GL11.GL_FOG_START, 0.0f);
GL11.glFogf(GL11.GL_FOG_END, Float.MAX_VALUE);
GL11.glFogf(GL11.GL_FOG_DENSITY, 0.0f);
return true;
}
return false;
}
}
@@ -172,9 +172,8 @@ public class LodRenderer
GLProxy glProxy = GLProxy.getInstance();
if (canVanillaFogBeDisabled && CONFIG.client().graphics().fogQuality().getDisableVanillaFog())
if (!glProxy.disableLegacyFog())
if (!MC_RENDER.tryDisableVanillaFog())
canVanillaFogBeDisabled = false;
if (!MC_RENDER.tryDisableVanillaFog())
canVanillaFogBeDisabled = false;
// TODO move the buffer regeneration logic into its own class (probably called in the client api instead)
// starting here...
@@ -121,10 +121,7 @@ public interface IMinecraftRenderWrapper
/** @returns -1 if there was an issue getting the lightmap */
public int getLightmapGLFormat();
/** Try and disable vanilla fog. Return true if successful, or false if not able to.
* If we are still using legacy fog, this method will not be called. */
public default boolean tryDisableVanillaFog() {
return false;
}
// Try and disable vanilla fog. Return true if successful, or false if not able to.
public boolean tryDisableVanillaFog();
}