Merge branch 'dev' into shader-pipeline

This commit is contained in:
Jozufozu 2021-08-06 11:45:39 -07:00
commit 935f8efc00
7 changed files with 16 additions and 62 deletions

View File

@ -1,3 +1,7 @@
0.2.3:
Technical/API:
- Alter BeginFrameEvent to enable compatibility with optifine shadows
0.2.2:
Fixes
- Fix ConcurrentModificationException crash

View File

@ -1,7 +1,7 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
# mod version info
mod_version=0.2.2
mod_version=0.2.3
mc_update_version=1.16
minecraft_version=1.16.5
forge_version=36.1.66

View File

@ -1,16 +0,0 @@
package com.jozufozu.flywheel.core;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.client.renderer.culling.ClippingHelper;
/**
* Used to capture the ClippingHelper from WorldRenderer#renderLevel
*/
public class Clipping {
/**
* Assigned in {@link com.jozufozu.flywheel.mixin.GlobalClippingHelperMixin this} mixin.
*/
public static ClippingHelper HELPER;
}

View File

@ -7,22 +7,17 @@ import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.culling.ClippingHelper;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraftforge.eventbus.api.Event;
public class BeginFrameEvent extends Event {
private final ClientWorld world;
private final MatrixStack stack;
private final ActiveRenderInfo info;
private final GameRenderer gameRenderer;
private final LightTexture lightTexture;
private final ClippingHelper clippingHelper;
public BeginFrameEvent(ClientWorld world, MatrixStack stack, ActiveRenderInfo info, GameRenderer gameRenderer, LightTexture lightTexture, ClippingHelper clippingHelper) {
public BeginFrameEvent(ClientWorld world, ActiveRenderInfo info, ClippingHelper clippingHelper) {
this.world = world;
this.stack = stack;
this.info = info;
this.gameRenderer = gameRenderer;
this.lightTexture = lightTexture;
this.clippingHelper = clippingHelper;
}
@ -30,23 +25,15 @@ public class BeginFrameEvent extends Event {
return world;
}
public MatrixStack getStack() {
return stack;
}
public ActiveRenderInfo getInfo() {
return info;
}
public GameRenderer getGameRenderer() {
return gameRenderer;
}
public LightTexture getLightTexture() {
return lightTexture;
}
public ClippingHelper getClippingHelper() {
return clippingHelper;
}
public Vector3d getCameraPos() {
return info.getPosition();
}
}

View File

@ -1,20 +0,0 @@
package com.jozufozu.flywheel.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import com.jozufozu.flywheel.core.Clipping;
import net.minecraft.client.renderer.culling.ClippingHelper;
import net.minecraft.util.math.vector.Matrix4f;
@Mixin(ClippingHelper.class)
public class GlobalClippingHelperMixin {
@Inject(at = @At("TAIL"), method = "<init>")
private void init(Matrix4f p_i226026_1_, Matrix4f p_i226026_2_, CallbackInfo ci) {
Clipping.HELPER = (ClippingHelper) (Object) this;
}
}

View File

@ -11,7 +11,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import com.jozufozu.flywheel.backend.Backend;
import com.jozufozu.flywheel.backend.OptifineHandler;
import com.jozufozu.flywheel.backend.instancing.InstancedRenderDispatcher;
import com.jozufozu.flywheel.core.Clipping;
import com.jozufozu.flywheel.core.crumbling.CrumblingRenderer;
import com.jozufozu.flywheel.event.BeginFrameEvent;
import com.jozufozu.flywheel.event.ReloadRenderersEvent;
@ -25,6 +24,7 @@ import net.minecraft.client.renderer.LightTexture;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.RenderTypeBuffers;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.culling.ClippingHelper;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Matrix4f;
@ -44,9 +44,9 @@ public class RenderHooksMixin {
@Final
private RenderTypeBuffers renderBuffers;
@Inject(at = @At(value = "INVOKE", target = "net.minecraft.client.renderer.WorldRenderer.compileChunksUntil(J)V"), method = "renderLevel")
private void setupFrame(MatrixStack stack, float p_228426_2_, long p_228426_3_, boolean p_228426_5_, ActiveRenderInfo info, GameRenderer gameRenderer, LightTexture lightTexture, Matrix4f projection, CallbackInfo ci) {
MinecraftForge.EVENT_BUS.post(new BeginFrameEvent(level, stack, info, gameRenderer, lightTexture, Clipping.HELPER));
@Inject(at = @At("HEAD"), method = "setupRender")
private void setupRender(ActiveRenderInfo info, ClippingHelper clippingHelper, boolean p_228437_3_, int frameCount, boolean isSpectator, CallbackInfo ci) {
MinecraftForge.EVENT_BUS.post(new BeginFrameEvent(level, info, clippingHelper));
}
/**

View File

@ -18,8 +18,7 @@
"atlas.SheetDataAccessor",
"light.LightUpdateMixin",
"light.NetworkLightUpdateMixin",
"FastChunkProviderMixin",
"GlobalClippingHelperMixin"
"FastChunkProviderMixin"
],
"injectors": {
"defaultRequire": 0