Fix fading when Sodium is installed
This commit is contained in:
+1
-1
Submodule coreSubProjects updated: 57aec6092c...b3928d3b1f
@@ -293,7 +293,7 @@ public class FabricClientProxy implements AbstractModInitializer.IEventProxy
|
||||
ClientApi.INSTANCE.renderDeferredLodsForShaders(ClientLevelWrapper.getWrapper();
|
||||
#endif
|
||||
|
||||
this.clientApi.renderFade();
|
||||
this.clientApi.renderFadeTransparent();
|
||||
});
|
||||
#endif
|
||||
|
||||
|
||||
+7
-18
@@ -43,38 +43,27 @@ public class MixinChunkSectionsToRender
|
||||
{
|
||||
|
||||
|
||||
// needs to fire at HEAD otherwise it will be canceled by Sodium
|
||||
@Inject(at = @At("HEAD"), method = "renderGroup")
|
||||
// needs to fire at HEAD with a lower than normal order (less than 1000)
|
||||
// otherwise it will be canceled by Sodium
|
||||
@Inject(at = @At("HEAD"), method = "renderGroup", order = 800)
|
||||
private void renderDeferredLayer(ChunkSectionLayerGroup chunkSectionLayerGroup, CallbackInfo ci)
|
||||
{
|
||||
ClientApi.RENDER_STATE.clientLevelWrapper = ClientLevelWrapper.getWrapperIfDifferent(ClientApi.RENDER_STATE.clientLevelWrapper, Minecraft.getInstance().levelRenderer.level);
|
||||
|
||||
|
||||
if (chunkSectionLayerGroup == ChunkSectionLayerGroup.OPAQUE)
|
||||
{
|
||||
ClientApi.INSTANCE.renderFadeOpaque();
|
||||
}
|
||||
else if (chunkSectionLayerGroup == ChunkSectionLayerGroup.TRANSLUCENT)
|
||||
if (chunkSectionLayerGroup == ChunkSectionLayerGroup.TRANSLUCENT)
|
||||
{
|
||||
ClientApi.INSTANCE.renderFadeTransparent();
|
||||
ClientApi.INSTANCE.renderDeferredLodsForShaders();
|
||||
}
|
||||
}
|
||||
|
||||
// canceled by sodium, but there isn't a better way to handle it right now
|
||||
// https://github.com/CaffeineMC/sodium/blob/dev/common/src/main/java/net/caffeinemc/mods/sodium/mixin/core/render/world/ChunkSectionsToRenderMixin.java
|
||||
@Inject(at = @At("RETURN"), method = "renderGroup")
|
||||
private void renderOpaqueFade(ChunkSectionLayerGroup chunkSectionLayerGroup, CallbackInfo ci)
|
||||
{
|
||||
ClientApi.RENDER_STATE.clientLevelWrapper = ClientLevelWrapper.getWrapperIfDifferent(ClientApi.RENDER_STATE.clientLevelWrapper, Minecraft.getInstance().levelRenderer.level);
|
||||
|
||||
|
||||
if (chunkSectionLayerGroup == ChunkSectionLayerGroup.OPAQUE)
|
||||
else if (chunkSectionLayerGroup == ChunkSectionLayerGroup.TRIPWIRE)
|
||||
{
|
||||
ClientApi.INSTANCE.renderFadeOpaque();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
-16
@@ -183,22 +183,6 @@ public class MixinLevelRenderer
|
||||
|
||||
}
|
||||
|
||||
@Inject(at = @At("RETURN"), method = "renderLevel")
|
||||
private void postRenderLevel(GraphicsResourceAllocator graphicsResourceAllocator, DeltaTracker deltaTracker, boolean bl, Camera camera, Matrix4f matrix4f, Matrix4f matrix4f2, Matrix4f matrix4f3, GpuBufferSlice gpuBufferSlice, Vector4f vector4f, boolean bl2, CallbackInfo ci)
|
||||
{
|
||||
ClientApi.RENDER_STATE.clientLevelWrapper = ClientLevelWrapper.getWrapperIfDifferent(ClientApi.RENDER_STATE.clientLevelWrapper, this.level);
|
||||
ClientApi.RENDER_STATE.frameTime = deltaTracker.getGameTimeDeltaTicks();
|
||||
|
||||
// only crash during development
|
||||
if (ModInfo.IS_DEV_BUILD)
|
||||
{
|
||||
ClientApi.RENDER_STATE.canRenderOrThrow();
|
||||
}
|
||||
|
||||
ClientApi.INSTANCE.renderFade();
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -170,7 +170,7 @@ public class MixinLevelRenderer
|
||||
}
|
||||
else if (renderType.equals(RenderType.tripwire()))
|
||||
{
|
||||
ClientApi.INSTANCE.renderFade();
|
||||
ClientApi.INSTANCE.renderFadeTransparent();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ public class NeoforgeClientProxy implements AbstractModInitializer.IEventProxy
|
||||
ClientApi.RENDER_STATE.clientLevelWrapper = ClientLevelWrapper.getWrapperIfDifferent(ClientApi.RENDER_STATE.clientLevelWrapper, event.getLevelRenderer().level);
|
||||
#endif
|
||||
|
||||
ClientApi.INSTANCE.renderFade();
|
||||
ClientApi.INSTANCE.renderFadeTransparent();
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -148,7 +148,7 @@ public class MixinLevelRenderer
|
||||
}
|
||||
else if (renderType.equals(RenderType.tripwire()))
|
||||
{
|
||||
ClientApi.INSTANCE.renderFade();
|
||||
ClientApi.INSTANCE.renderFadeTransparent();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user