mirror of
https://github.com/GTNewHorizons/Angelica.git
synced 2026-11-14 01:14:08 +00:00
Draw translucent-pass block entities before translucent terrain
This commit is contained in:
7 files changed
+160
-29
No files matched your search
@@ -6,6 +6,8 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public final class StateSet {
|
||||
|
||||
public static final int R_DEPTH = 1;
|
||||
@@ -79,28 +81,47 @@ public final class StateSet {
|
||||
public static final StateSet CUTOUT = buildCutout();
|
||||
public static final StateSet MASKS = buildMasks();
|
||||
public static final StateSet CULL = buildCull();
|
||||
public static final StateSet BLOCK_ENTITY_PASS = buildBlockEntityPass();
|
||||
|
||||
private static CowStateStack<?>[] batchMembers() {
|
||||
return new CowStateStack<?>[] {
|
||||
GLSMBlend.getBlendState(), GLSMDepthStencilAlpha.getAlphaState(), GLSMDepthStencilAlpha.getDepthState(),
|
||||
GLSMBlend.getColorMask(), GLSMRasterizer.getPolygonState(),
|
||||
GLSMTextures.getTextures().getTextureUnitBindings(0), GLSMTextures.getTextures().getTextureUnitBindings(1),
|
||||
GLSMTextures.getActiveTextureUnitStack(),
|
||||
GLSMBlend.getBlendMode(), GLSMDepthStencilAlpha.getAlphaTest(), GLSMDepthStencilAlpha.getDepthTest(),
|
||||
GLSMLighting.getLightingState(), GLSMRasterizer.getCullState(), GLSMRasterizer.getPolygonOffsetFillState(),
|
||||
GLSMTextures.getTextures().getTextureUnitStates(0), GLSMTextures.getTextures().getTextureUnitStates(1),
|
||||
GLSMLighting.getLightStates()[0], GLSMLighting.getLightStates()[1],
|
||||
GLSMLighting.getLightDataStates()[0], GLSMLighting.getLightDataStates()[1],
|
||||
GLSMLighting.getColorMaterial(), GLSMLighting.getColorMaterialFace(), GLSMLighting.getColorMaterialParameter(),
|
||||
GLSMLighting.getLightModel(), GLSMLighting.getFrontMaterial(), GLSMLighting.getBackMaterial(),
|
||||
GLSMLighting.getNormalizeState(), GLSMLighting.getRescaleNormalState()
|
||||
};
|
||||
}
|
||||
|
||||
private static StateSet buildBatch() {
|
||||
return new StateSet(0,
|
||||
ids(
|
||||
GLSMBlend.getBlendState(), GLSMDepthStencilAlpha.getAlphaState(), GLSMDepthStencilAlpha.getDepthState(),
|
||||
GLSMBlend.getColorMask(), GLSMRasterizer.getPolygonState(),
|
||||
GLSMTextures.getTextures().getTextureUnitBindings(0), GLSMTextures.getTextures().getTextureUnitBindings(1),
|
||||
GLSMTextures.getActiveTextureUnitStack(),
|
||||
GLSMBlend.getBlendMode(), GLSMDepthStencilAlpha.getAlphaTest(), GLSMDepthStencilAlpha.getDepthTest(),
|
||||
GLSMLighting.getLightingState(), GLSMRasterizer.getCullState(), GLSMRasterizer.getPolygonOffsetFillState(),
|
||||
GLSMTextures.getTextures().getTextureUnitStates(0), GLSMTextures.getTextures().getTextureUnitStates(1),
|
||||
GLSMLighting.getLightStates()[0], GLSMLighting.getLightStates()[1],
|
||||
GLSMLighting.getLightDataStates()[0], GLSMLighting.getLightDataStates()[1],
|
||||
GLSMLighting.getColorMaterial(), GLSMLighting.getColorMaterialFace(), GLSMLighting.getColorMaterialParameter(),
|
||||
GLSMLighting.getLightModel(), GLSMLighting.getFrontMaterial(), GLSMLighting.getBackMaterial(),
|
||||
GLSMLighting.getNormalizeState(), GLSMLighting.getRescaleNormalState()
|
||||
),
|
||||
ids(batchMembers()),
|
||||
R_BLEND | R_DEPTH | R_COLOR_MASK | R_POLYGON | R_TEXTURE | R_ACTIVE_UNIT,
|
||||
B_FRAG_COLORBUF | B_LIGHTING,
|
||||
true);
|
||||
}
|
||||
|
||||
private static StateSet buildBlockEntityPass() {
|
||||
final CowStateStack<?>[] batch = batchMembers();
|
||||
final CowStateStack<?>[] all = Arrays.copyOf(batch, batch.length + 4);
|
||||
all[batch.length] = GLSMCurrentAttribs.getColor();
|
||||
all[batch.length + 1] = GLSMFog.getFogState();
|
||||
all[batch.length + 2] = GLSMFog.getFogMode();
|
||||
all[batch.length + 3] = GLSMRasterizer.getShadeModelState();
|
||||
return new StateSet(0,
|
||||
ids(all),
|
||||
R_BLEND | R_DEPTH | R_COLOR_MASK | R_POLYGON | R_TEXTURE | R_ACTIVE_UNIT,
|
||||
B_FRAG_COLORBUF | B_LIGHTING | B_CURRENT | B_FRAG_FOG,
|
||||
true);
|
||||
}
|
||||
|
||||
private static StateSet buildFont() {
|
||||
return new StateSet(0,
|
||||
ids(
|
||||
|
||||
@@ -167,6 +167,33 @@ public class GLSM_StateSet_GLTest {
|
||||
|| GLSMBlend.getColorMask().blue || GLSMBlend.getColorMask().alpha, "cache color mask - not a HAND member, must stay toggled");
|
||||
}
|
||||
|
||||
@Test
|
||||
void blockEntityPassRestoresColorFogAndShadeModelOnTopOfBatchButNotStencil() {
|
||||
GLSMCurrentAttribs.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
GLSMFog.disableFog();
|
||||
GLSMFog.glFogf(GL11.GL_FOG_END, 64.0f);
|
||||
GLSMRasterizer.glShadeModel(GL11.GL_SMOOTH);
|
||||
GLSMDepthStencilAlpha.glDepthMask(true);
|
||||
GLSMEnable.glDisable(GL11.GL_STENCIL_TEST);
|
||||
|
||||
final int d = GLSMAttribStack.pushState(StateSet.BLOCK_ENTITY_PASS);
|
||||
GLSMCurrentAttribs.glColor4f(0.2f, 0.4f, 0.6f, 0.8f);
|
||||
GLSMFog.enableFog();
|
||||
GLSMFog.glFogf(GL11.GL_FOG_END, 8.0f);
|
||||
GLSMRasterizer.glShadeModel(GL11.GL_FLAT);
|
||||
GLSMDepthStencilAlpha.glDepthMask(false);
|
||||
GLSMEnable.glEnable(GL11.GL_STENCIL_TEST);
|
||||
GLSMAttribStack.popStateTo(d);
|
||||
|
||||
assertEquals(1.0f, GLSMCurrentAttribs.getColor().getRed(), "cache color red");
|
||||
assertEquals(1.0f, GLSMCurrentAttribs.getColor().getAlpha(), "cache color alpha");
|
||||
assertFalse(GLSMFog.getFogMode().isEnabled(), "fog enable restored by BLOCK_ENTITY_PASS pop");
|
||||
assertEquals(64.0f, GLSMFog.getFogState().getEnd(), "cache fog end");
|
||||
assertEquals(GL11.GL_SMOOTH, GLSMRasterizer.getShadeModelState().getValue(), "cache shade model");
|
||||
assertTrue(GLSMDepthStencilAlpha.getDepthState().isEnabled(), "depth mask restored, as in BATCH");
|
||||
verifyIsEnabled(GL11.GL_STENCIL_TEST, true, "Stencil test - not a BLOCK_ENTITY_PASS member, must stay toggled");
|
||||
}
|
||||
|
||||
@Test
|
||||
void masksRestoresDepthMaskAndColorMaskButNotDepthTestEnable() {
|
||||
GLSMDepthStencilAlpha.glDepthMask(true);
|
||||
|
||||
+68
@@ -7,11 +7,13 @@ import com.gtnewhorizons.angelica.compat.bop.FogBiomeCache;
|
||||
import com.gtnewhorizons.angelica.render.CloudRenderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||
@@ -35,15 +37,21 @@ import org.embeddedt.embeddium.impl.render.viewport.frustum.SimpleFrustum;
|
||||
import org.joml.FrustumIntersection;
|
||||
import org.joml.Matrix4f;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL13;
|
||||
|
||||
import com.gtnewhorizons.angelica.compat.ModStatus;
|
||||
import com.gtnewhorizons.angelica.compat.cubicchunks.CubicChunksAPI;
|
||||
import com.gtnewhorizons.angelica.config.AngelicaConfig;
|
||||
import com.gtnewhorizons.angelica.dynamiclights.DynamicLights;
|
||||
import com.gtnewhorizons.angelica.dynamiclights.IDynamicLightWorldRenderer;
|
||||
import com.gtnewhorizons.angelica.glsm.GLSMAttribStack;
|
||||
import com.gtnewhorizons.angelica.glsm.GLSMBlend;
|
||||
import com.gtnewhorizons.angelica.glsm.GLSMCurrentAttribs;
|
||||
import com.gtnewhorizons.angelica.glsm.GLSMDepthStencilAlpha;
|
||||
import com.gtnewhorizons.angelica.glsm.GLSMMatrices;
|
||||
import com.gtnewhorizons.angelica.glsm.GLSMRasterizer;
|
||||
import com.gtnewhorizons.angelica.glsm.GLSMTextures;
|
||||
import com.gtnewhorizons.angelica.glsm.StateSet;
|
||||
import com.gtnewhorizons.angelica.glsm.ffp.FfpExtendedAttribs;
|
||||
import com.gtnewhorizons.angelica.glsm.profiling.Tracy;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.ITileEntityBoundingBoxCache;
|
||||
@@ -64,6 +72,8 @@ import com.gtnewhorizons.angelica.rendering.celeritas.api.IrisShaderProviderHold
|
||||
import com.gtnewhorizons.angelica.rendering.tesr.TesrAttribution;
|
||||
import com.gtnewhorizons.angelica.rendering.tesr.TesrBatchRenderer;
|
||||
import com.gtnewhorizons.angelica.rendering.tesr.TesrLifecycle;
|
||||
import net.coderbot.iris.Iris;
|
||||
import net.coderbot.iris.layer.GbufferPrograms;
|
||||
import net.coderbot.iris.pipeline.ShadowRenderer;
|
||||
|
||||
public class CeleritasWorldRenderer extends SimpleWorldRenderer<WorldClient, AngelicaRenderSectionManager, BlockRenderLayer, TileEntity, CeleritasWorldRenderer.TileEntityRenderContext> implements IDynamicLightWorldRenderer {
|
||||
@@ -73,6 +83,7 @@ public class CeleritasWorldRenderer extends SimpleWorldRenderer<WorldClient, Ang
|
||||
private static final Tracy.ZoneId Z_TESR_DISPATCH = Tracy.zoneId("tesrDispatch", Tracy.COLOR_CLIENT);
|
||||
private static final Tracy.ZoneId Z_TESR_MODEL_PARTS = Tracy.zoneId("tesrModelParts", Tracy.COLOR_CLIENT);
|
||||
private static final Tracy.ZoneId Z_TESR_RENDER_TE = Tracy.zoneId("tesrRenderTE", Tracy.COLOR_CLIENT);
|
||||
private static final long P_BLOCK_ENTITIES_RENDERED = Tracy.plotHandle("blockEntitiesRendered");
|
||||
|
||||
private final Minecraft mc;
|
||||
private static CeleritasWorldRenderer instance;
|
||||
@@ -94,6 +105,10 @@ public class CeleritasWorldRenderer extends SimpleWorldRenderer<WorldClient, Ang
|
||||
private final ObjectArrayList<TileEntity> frameOverride = new ObjectArrayList<>();
|
||||
|
||||
private final TileEntityDepthOrder depthOrder = new TileEntityDepthOrder();
|
||||
private final Matrix4f savedTextureMatrix = new Matrix4f();
|
||||
private PassOne passOne = PassOne.NONE;
|
||||
|
||||
private enum PassOne { NONE, PENDING, DRAWN_EARLY }
|
||||
|
||||
private CeleritasWorldRenderer(Minecraft mc) {
|
||||
// Private constructor for singleton
|
||||
@@ -403,6 +418,58 @@ public class CeleritasWorldRenderer extends SimpleWorldRenderer<WorldClient, Ang
|
||||
GLSMCurrentAttribs.glColor4f(1, 1, 1, 1);
|
||||
}
|
||||
|
||||
public void renderBlockEntitiesBeforeTranslucent(float partialTicks) {
|
||||
if (passOne != PassOne.PENDING) return;
|
||||
passOne = PassOne.DRAWN_EARLY;
|
||||
if (frameOverride.isEmpty()) return;
|
||||
final Minecraft mc = Minecraft.getMinecraft();
|
||||
final int previousPass = MinecraftForgeClient.getRenderPass();
|
||||
final int depth = GLSMAttribStack.pushState(StateSet.BLOCK_ENTITY_PASS);
|
||||
savedTextureMatrix.set(GLSMTextures.getTextures().getTextureUnitMatrix(0));
|
||||
GLSMMatrices.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GLSMMatrices.glPushMatrix();
|
||||
try {
|
||||
GLSMDepthStencilAlpha.glDepthMask(true);
|
||||
GLSMDepthStencilAlpha.enableAlphaTest();
|
||||
GLSMTextures.glActiveTexture(GL13.GL_TEXTURE0);
|
||||
GLSMTextures.enableTexture();
|
||||
GLSMCurrentAttribs.glColor4f(1f, 1f, 1f, 1f);
|
||||
if (mc.gameSettings.fancyGraphics) {
|
||||
GLSMBlend.disableBlend();
|
||||
GLSMRasterizer.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
RenderHelper.enableStandardItemLighting();
|
||||
mc.entityRenderer.enableLightmap(partialTicks);
|
||||
ForgeHooksClient.setRenderPass(1);
|
||||
renderBlockEntitiesInPhase(partialTicks);
|
||||
} finally {
|
||||
ForgeHooksClient.setRenderPass(previousPass);
|
||||
GLSMMatrices.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GLSMMatrices.glPopMatrix();
|
||||
GLSMMatrices.setTextureMatrix(0, savedTextureMatrix);
|
||||
GLSMAttribStack.popStateTo(depth);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean takeLatePassOne() {
|
||||
final boolean late = passOne != PassOne.DRAWN_EARLY;
|
||||
passOne = PassOne.NONE;
|
||||
return late;
|
||||
}
|
||||
|
||||
public void renderBlockEntitiesInPhase(float partialTicks) {
|
||||
if (Iris.enabled) {
|
||||
GbufferPrograms.beginBlockEntities();
|
||||
GbufferPrograms.setBlockEntityDefaults();
|
||||
}
|
||||
try {
|
||||
final int rendered = renderBlockEntities(partialTicks);
|
||||
if (Tracy.ENABLED) Tracy.plotInt(P_BLOCK_ENTITIES_RENDERED, rendered);
|
||||
} finally {
|
||||
if (Iris.enabled) GbufferPrograms.endBlockEntities();
|
||||
}
|
||||
}
|
||||
|
||||
public int renderBlockEntities(float partialTicks) {
|
||||
AngelicaTesrMeshCache.INSTANCE.tick();
|
||||
final int pass = MinecraftForgeClient.getRenderPass();
|
||||
@@ -456,6 +523,7 @@ public class CeleritasWorldRenderer extends SimpleWorldRenderer<WorldClient, Ang
|
||||
} finally {
|
||||
if (Tracy.ENABLED) Tracy.endZone();
|
||||
}
|
||||
passOne = PassOne.PENDING;
|
||||
} else {
|
||||
if (Tracy.ENABLED) Tracy.beginZone(Z_TESR_DISPATCH);
|
||||
try {
|
||||
|
||||
@@ -412,6 +412,14 @@ public class SodiumGameOptionPages {
|
||||
.setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD)
|
||||
.build()
|
||||
)
|
||||
.add(OptionImpl.createBuilder(boolean.class, sodiumOpts)
|
||||
.setName(I18n.format("sodium.options.block_entities_before_translucent_terrain.name"))
|
||||
.setTooltip(I18n.format("sodium.options.block_entities_before_translucent_terrain.tooltip"))
|
||||
.setControl(TickBoxControl::new)
|
||||
.setBinding((opts, value) -> opts.performance.blockEntitiesBeforeTranslucentTerrain = value, opts -> opts.performance.blockEntitiesBeforeTranslucentTerrain)
|
||||
.setImpact(OptionImpact.LOW)
|
||||
.build()
|
||||
)
|
||||
.add(OptionImpl.createBuilder(boolean.class, sodiumOpts)
|
||||
.setName(I18n.format("sodium.options.use_entity_culling.name"))
|
||||
.setTooltip(I18n.format("sodium.options.use_entity_culling.tooltip"))
|
||||
|
||||
@@ -234,6 +234,7 @@ public class SodiumGameOptions {
|
||||
public boolean useBlockFaceCulling = true;
|
||||
public boolean useCompactVertexFormat = true;
|
||||
public boolean translucencySorting = true;
|
||||
public boolean blockEntitiesBeforeTranslucentTerrain = true;
|
||||
public boolean useRenderPassOptimization = true;
|
||||
public int cpuRenderAheadLimit = 3;
|
||||
}
|
||||
|
||||
@@ -91,6 +91,8 @@ sodium.options.animate_only_visible_textures.name=Animate Only Visible Textures
|
||||
sodium.options.animate_only_visible_textures.tooltip=If enabled, only animated textures determined to be visible will be updated. This can provide a significant boost to frame rates on some hardware, especially with heavier resource packs. If you experience issues with some textures not being animated, try disabling this option.
|
||||
sodium.options.translucency_sorting.name=Translucency Sorting
|
||||
sodium.options.translucency_sorting.tooltip=If enabled, translucent terrain (water, stained glass, ice) and translucent tile entities are sorted back to front so overlapping layers draw correctly. Disabling improves performance in scenes with lots of translucent blocks but causes layering artifacts. Changing this reloads chunks.
|
||||
sodium.options.block_entities_before_translucent_terrain.name=Tile Entities Before Translucent Terrain
|
||||
sodium.options.block_entities_before_translucent_terrain.tooltip=If enabled, translucent tile entities are drawn before translucent terrain (water, stained glass, ice), so that the latter does not hide the former behind it. Tile Entities in front of terrain may hide the terrain, and glows in front of terrain may appear behind it.
|
||||
sodium.options.cpu_render_ahead_limit.name=CPU Render-Ahead Limit
|
||||
sodium.options.cpu_render_ahead_limit.tooltip=How many frames the CPU may run ahead of the GPU. Lower values cut input latency, higher values smooth out uneven frame times. Very low or high values may create frame rate instability. 0 disables it; the SDL-GPU backend ignores it and applies its own backpressure.
|
||||
sodium.options.cpu_render_ahead_limit.value=%s frame(s)
|
||||
|
||||
+19
-15
@@ -9,6 +9,7 @@ import com.gtnewhorizons.angelica.glsm.GLSMEnable;
|
||||
import com.gtnewhorizons.angelica.glsm.GLSMTextures;
|
||||
import com.gtnewhorizons.angelica.glsm.profiling.Tracy;
|
||||
import com.gtnewhorizons.angelica.mixins.interfaces.IRenderGlobalExt;
|
||||
import com.gtnewhorizons.angelica.proxy.ClientProxy;
|
||||
import com.gtnewhorizons.angelica.rendering.AngelicaRenderQueue;
|
||||
import com.gtnewhorizons.angelica.rendering.RenderingState;
|
||||
import com.gtnewhorizons.angelica.rendering.celeritas.BlockRenderLayer;
|
||||
@@ -18,7 +19,6 @@ import com.gtnewhorizons.angelica.rendering.tesr.ModelPartBatcher;
|
||||
import com.gtnewhorizons.angelica.rendering.tesr.TesrBatchRenderer;
|
||||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
|
||||
import net.coderbot.iris.Iris;
|
||||
import net.coderbot.iris.layer.GbufferPrograms;
|
||||
import net.coderbot.iris.pipeline.HandRenderer;
|
||||
import net.coderbot.iris.pipeline.WorldRenderingPhase;
|
||||
import net.coderbot.iris.pipeline.WorldRenderingPipeline;
|
||||
@@ -34,6 +34,7 @@ import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import org.embeddedt.embeddium.impl.gl.device.RenderDevice;
|
||||
import org.embeddedt.embeddium.impl.render.terrain.SimpleWorldRenderer;
|
||||
import org.embeddedt.embeddium.impl.render.viewport.Viewport;
|
||||
@@ -63,7 +64,6 @@ import static org.joml.Math.lerp;
|
||||
*/
|
||||
@Mixin(value = RenderGlobal.class, priority = 900)
|
||||
public class MixinRenderGlobal implements IRenderGlobalExt {
|
||||
@Unique private static final long P_BLOCK_ENTITIES_RENDERED = Tracy.plotHandle("blockEntitiesRendered");
|
||||
@Unique private static final Tracy.ZoneId Z_MT_QUEUE = Tracy.zoneId("mtQueue", Tracy.COLOR_TERRAIN);
|
||||
|
||||
@Shadow public Minecraft mc;
|
||||
@@ -146,10 +146,13 @@ public class MixinRenderGlobal implements IRenderGlobalExt {
|
||||
pipeline = Iris.getPipelineManager().getPipelineNullable();
|
||||
if (pass == 0) {
|
||||
pipeline.setPhase(WorldRenderingPhase.TERRAIN_SOLID);
|
||||
} else if (pass == 1) {
|
||||
if (!ShadowRenderingState.areShadowsCurrentlyBeingRendered()) {
|
||||
iris$beginTranslucents(pipeline, Camera.INSTANCE);
|
||||
}
|
||||
} else if (pass == 1 && !ShadowRenderingState.areShadowsCurrentlyBeingRendered()) {
|
||||
iris$beginTranslucents(pipeline, Camera.INSTANCE);
|
||||
}
|
||||
}
|
||||
if (pass == 1) {
|
||||
celeritas$renderBlockEntitiesBeforeTranslucent(partialTicks);
|
||||
if (pipeline != null) {
|
||||
pipeline.setPhase(WorldRenderingPhase.TERRAIN_TRANSLUCENT);
|
||||
this.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
}
|
||||
@@ -276,17 +279,18 @@ public class MixinRenderGlobal implements IRenderGlobalExt {
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/RenderHelper;enableStandardItemLighting()V", ordinal = 0))
|
||||
private void celeritas$enterBlockEntities() {}
|
||||
|
||||
@Unique
|
||||
private void celeritas$renderBlockEntitiesBeforeTranslucent(double partialTicks) {
|
||||
if (ShadowRenderingState.areShadowsCurrentlyBeingRendered()) return;
|
||||
if (!ClientProxy.options().performance.blockEntitiesBeforeTranslucentTerrain) return;
|
||||
if (this.mc.entityRenderer.debugViewDirection != 0) return;
|
||||
this.celeritas$renderer.renderBlockEntitiesBeforeTranslucent((float) partialTicks);
|
||||
}
|
||||
|
||||
@Surround.Return("blockEntities")
|
||||
private void celeritas$renderTileEntities(@Surround.Local(argsOnly = true) float partialTicks) {
|
||||
if (Iris.enabled) {
|
||||
GbufferPrograms.beginBlockEntities();
|
||||
GbufferPrograms.setBlockEntityDefaults();
|
||||
}
|
||||
final int blockEntitiesRendered = this.celeritas$renderer.renderBlockEntities(partialTicks);
|
||||
if (Tracy.ENABLED) Tracy.plotInt(P_BLOCK_ENTITIES_RENDERED, blockEntitiesRendered);
|
||||
if (Iris.enabled) {
|
||||
GbufferPrograms.endBlockEntities();
|
||||
}
|
||||
if (MinecraftForgeClient.getRenderPass() == 1 && !this.celeritas$renderer.takeLatePassOne()) return;
|
||||
this.celeritas$renderer.renderBlockEntitiesInPhase(partialTicks);
|
||||
}
|
||||
|
||||
@ModifyExpressionValue(method = "renderEntities", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/RenderGlobal;tileEntities:Ljava/util/List;", opcode = Opcodes.GETFIELD))
|
||||
|
||||
Reference in new issue
Block a user