25w36b
This commit is contained in:
1 parent
6533716c93
commit
f371e2e8bd
29 files changed
+222
-153
No files matched your search
@@ -6,14 +6,18 @@ import com.mojang.blaze3d.buffers.GpuBufferSlice;
|
||||
import com.mojang.blaze3d.framegraph.FrameGraphBuilder;
|
||||
import com.mojang.blaze3d.framegraph.FramePass;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.DeltaTracker;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.LevelRenderState;
|
||||
import net.minecraft.client.renderer.LevelRenderer;
|
||||
import net.minecraft.client.renderer.LevelTargetBundle;
|
||||
import net.minecraft.client.renderer.RenderBuffers;
|
||||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderDispatcher;
|
||||
import net.minecraft.client.renderer.culling.Frustum;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
|
||||
import net.minecraft.client.renderer.feature.FeatureRenderDispatcher;
|
||||
import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import org.joml.Matrix4f;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -37,16 +41,17 @@ public class LevelRenderer_scarpetRenderMixin
|
||||
}
|
||||
|
||||
@Inject(method = "addMainPass", at = @At("RETURN"))
|
||||
private void renderScarpetThingsLate(FrameGraphBuilder frameGraphBuilder, Camera camera, float f, GpuBufferSlice fogParameters, CallbackInfo ci)
|
||||
private void renderScarpetThingsLate(FrameGraphBuilder frameGraphBuilder, Frustum frustum, Camera camera, Matrix4f matrix4f, GpuBufferSlice gpuBufferSlice, boolean bl, LevelRenderState levelRenderState, DeltaTracker deltaTracker, ProfilerFiller profilerFiller, CallbackInfo ci)
|
||||
{
|
||||
// in normal circumstances we want to render shapes at the very end so it appears correctly behind stuff.
|
||||
// we might actually not need to play with render hooks here.
|
||||
//if (!FabricAPIHooks.WORLD_RENDER_EVENTS && CarpetClient.shapes != null )
|
||||
if (CarpetClient.shapes != null)
|
||||
{
|
||||
final float deltaPartialTick = deltaTracker.getGameTimeDeltaPartialTick(false);
|
||||
FramePass pass = frameGraphBuilder.addPass("scarpet_shapes");
|
||||
targets.main = pass.readsAndWrites(targets.main);
|
||||
pass.executes(() -> CarpetClient.shapes.render(null, camera, f));
|
||||
pass.executes(() -> CarpetClient.shapes.render(null, camera, deltaPartialTick));
|
||||
featureRenderDispatcher.renderAllFeatures();
|
||||
renderBuffers.bufferSource().endLastBatch();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user