Fog rendering fixes
This commit is contained in:
parent
3cb78dd5a5
commit
c947af1211
3 changed files with 62 additions and 68 deletions
|
@ -27,9 +27,7 @@ public class CustomBackgroundRenderer {
|
|||
private static float fogEnd = 192;
|
||||
|
||||
public static boolean applyFogDensity(Camera camera, FogRenderer.FogMode fogMode, float viewDistance, boolean thickFog) {
|
||||
FogType fogType = camera.getFluidInCamera();
|
||||
|
||||
if (fogType == FogType.WATER || fogType == FogType.LAVA || fogMode != FogMode.FOG_SKY) {
|
||||
if (fogMode != FogMode.FOG_SKY && fogMode != FogMode.FOG_TERRAIN) {
|
||||
BackgroundInfo.fogDensity = 1;
|
||||
return false;
|
||||
}
|
||||
|
@ -49,7 +47,7 @@ public class CustomBackgroundRenderer {
|
|||
fogEnd = Math.min(viewDistance, 192.0F) * 0.5F / fog;
|
||||
}
|
||||
else {
|
||||
fogStart = viewDistance * 0.75F / fog;
|
||||
fogStart = 0;//viewDistance * 0.75F / fog;
|
||||
fogEnd = viewDistance / fog;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package ru.bclib.mixin.client;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.client.renderer.FogRenderer;
|
||||
|
@ -19,12 +20,7 @@ import ru.bclib.client.render.CustomBackgroundRenderer;
|
|||
import ru.bclib.util.BackgroundInfo;
|
||||
|
||||
@Mixin(FogRenderer.class)
|
||||
public class BackgroundRendererMixin {
|
||||
private static final MutableBlockPos BCLIB_LAST_POS = new MutableBlockPos(0, -100, 0);
|
||||
private static final MutableBlockPos BCLIB_MUT_POS = new MutableBlockPos();
|
||||
private static final float[] BCLIB_FOG_DENSITY = new float[8];
|
||||
//private static boolean isEnd;
|
||||
|
||||
public class FogRendererMixin {
|
||||
@Shadow
|
||||
private static float fogRed;
|
||||
@Shadow
|
|
@ -6,11 +6,11 @@
|
|||
"client": [
|
||||
"SimpleReloadableResourceManagerMixin",
|
||||
"EnchantingTableBlockMixin",
|
||||
"BackgroundRendererMixin",
|
||||
"ClientRecipeBookMixin",
|
||||
"ModelManagerMixin",
|
||||
"TextureAtlasMixin",
|
||||
"AnvilScreenMixin",
|
||||
"FogRendererMixin",
|
||||
"ModelBakeryMixin",
|
||||
"WorldPresetMixin",
|
||||
"MinecraftMixin",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue