Meldexun Posted February 17, 2019 Posted February 17, 2019 (edited) I want to change the fog of the game and the FogColors event works fine but the FogDensity event is not working for me. When i cancel the event and set the fog density to any value there is no fog at all. And when i don't cancel the event the fog density value isn't changing anything. thats my code: @SubscribeEvent public static void renderfog2(EntityViewRenderEvent.FogDensity event) { if (event.getEntity().isInsideOfMaterial(Material.WATER)) { event.setDensity(0.6f); event.setCanceled(true); } } Edited July 15, 2019 by Meldexun Quote
Meldexun Posted February 18, 2019 Author Posted February 18, 2019 So instead of setting the density with the event i now use GL11.glFogf(GL11.GL_FOG_DENSITY, 0.025f + 0.0025f * blocksUnderWater(event.getEntity())); If i'm missing something please tell me. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.