Merge branch 'distant-horizons-main'

This commit is contained in:
James Seibel
2024-01-21 19:24:42 -06:00
parent 4135fa6211
commit 0d165860fb
5 changed files with 144 additions and 26 deletions
@@ -51,17 +51,13 @@ import org.lwjgl.opengl.GL15;
/**
* This class is used to mix in my rendering code
* This class is used to mix in DH's rendering code
* before Minecraft starts rendering blocks.
* If this wasn't done, and we used Forge's
* render last event, the LODs would render on top
* of the normal terrain. <br><br>
*
* This is also the mixin for rendering the clouds
*
* @author coolGi
* @author James Seibel
* @version 12-31-2021
*/
@Mixin(LevelRenderer.class)
public class MixinLevelRenderer
@@ -88,6 +84,9 @@ public class MixinLevelRenderer
public void renderClouds(PoseStack poseStack, Matrix4f projectionMatrix, float partialTicks, double cameraX, double cameraY, double cameraZ, CallbackInfo ci)
#endif
{
// FIXME this is only called when clouds are enabled and vanilla render distance is far enough
// not having the partial ticks doesn't appear to be critical currently, but might cause weird issues down the line
// get the partial ticks since renderBlockLayer doesn't
// have access to them
previousPartialTicks = partialTicks;
@@ -138,7 +137,7 @@ public class MixinLevelRenderer
// only render before solid blocks
if (renderType.equals(RenderType.solid()))
{
ClientApi.INSTANCE.renderLods(ClientLevelWrapper.getWrapper(level), mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
ClientApi.INSTANCE.renderOpaqueLods(ClientLevelWrapper.getWrapper(level), mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
// experimental proof-of-concept option
if (Config.Client.Advanced.Graphics.AdvancedGraphics.seamlessOverdraw.get())
@@ -153,6 +152,10 @@ public class MixinLevelRenderer
projectionMatrix.set(matrixFloatArray);
#endif
}
}
else if (renderType.equals(RenderType.translucent()))
{
ClientApi.INSTANCE.renderTranslucentLods(ClientLevelWrapper.getWrapper(level), mcModelViewMatrix, mcProjectionMatrix, previousPartialTicks);
}
if (Config.Client.Advanced.Debugging.lodOnlyMode.get())