Jump to content

Recommended Posts

Posted (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 by Meldexun
Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.