--- a/net/minecraft/client/renderer/FogRenderer.java
+++ b/net/minecraft/client/renderer/FogRenderer.java
@@ -158,17 +158,28 @@
          }
 
          float f9 = Math.min(1.0F / field_205093_c, Math.min(1.0F / field_205094_d, 1.0F / field_205095_e));
+         // Forge: fix MC-4647 and MC-10480
+         if (Float.isInfinite(f9)) f9 = Math.nextAfter(f9, 0.0);
          field_205093_c = field_205093_c * (1.0F - f6) + field_205093_c * f9 * f6;
          field_205094_d = field_205094_d * (1.0F - f6) + field_205094_d * f9 * f6;
          field_205095_e = field_205095_e * (1.0F - f6) + field_205095_e * f9 * f6;
       } else if (p_228371_0_.func_216773_g() instanceof LivingEntity && ((LivingEntity)p_228371_0_.func_216773_g()).func_70644_a(Effects.field_76439_r)) {
          float f7 = GameRenderer.func_180438_a((LivingEntity)p_228371_0_.func_216773_g(), p_228371_1_);
          float f10 = Math.min(1.0F / field_205093_c, Math.min(1.0F / field_205094_d, 1.0F / field_205095_e));
+         // Forge: fix MC-4647 and MC-10480
+         if (Float.isInfinite(f10)) f10 = Math.nextAfter(f10, 0.0);
          field_205093_c = field_205093_c * (1.0F - f7) + field_205093_c * f10 * f7;
          field_205094_d = field_205094_d * (1.0F - f7) + field_205094_d * f10 * f7;
          field_205095_e = field_205095_e * (1.0F - f7) + field_205095_e * f10 * f7;
       }
 
+      net.minecraftforge.client.event.EntityViewRenderEvent.FogColors event = new net.minecraftforge.client.event.EntityViewRenderEvent.FogColors(p_228371_0_, p_228371_1_, field_205093_c, field_205094_d, field_205095_e);
+      net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
+
+      field_205093_c = event.getRed();
+      field_205094_d = event.getGreen();
+      field_205095_e = event.getBlue();
+
       RenderSystem.clearColor(field_205093_c, field_205094_d, field_205095_e, 0.0F);
    }
 
@@ -177,10 +188,18 @@
       RenderSystem.fogMode(GlStateManager.FogMode.EXP2);
    }
 
-   public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) {
+    @Deprecated // FORGE: Pass in partialTicks
+    public static void func_228372_a_(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_) {
+       setupFog(p_228372_0_, p_228372_1_, p_228372_2_, p_228372_3_, 0);
+    }
+
+    public static void setupFog(ActiveRenderInfo p_228372_0_, FogRenderer.FogType p_228372_1_, float p_228372_2_, boolean p_228372_3_, float partialTicks) {
       FluidState fluidstate = p_228372_0_.func_216771_k();
       Entity entity = p_228372_0_.func_216773_g();
       boolean flag = fluidstate.func_206886_c() != Fluids.field_204541_a;
+      float hook = net.minecraftforge.client.ForgeHooksClient.getFogDensity(p_228372_1_, p_228372_0_, partialTicks, 0.1F);
+      if (hook >= 0) RenderSystem.fogDensity(hook);
+      else
       if (fluidstate.func_206884_a(FluidTags.field_206959_a)) {
          float f = 1.0F;
          f = 0.05F;
@@ -231,6 +250,7 @@
          RenderSystem.fogEnd(f3);
          RenderSystem.fogMode(GlStateManager.FogMode.LINEAR);
          RenderSystem.setupNvFogDistance();
+         net.minecraftforge.client.ForgeHooksClient.onFogRender(p_228372_1_, p_228372_0_, partialTicks, f3);
       }
 
    }
