diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeFogRenderEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeFogRenderEvent.java new file mode 100644 index 000000000..613f07728 --- /dev/null +++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiBeforeFogRenderEvent.java @@ -0,0 +1,126 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.seibel.distanthorizons.api.methods.events.abstractEvents; + +import com.seibel.distanthorizons.api.interfaces.block.IDhApiBiomeWrapper; +import com.seibel.distanthorizons.api.interfaces.block.IDhApiBlockStateWrapper; +import com.seibel.distanthorizons.api.interfaces.world.IDhApiLevelWrapper; +import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiCancelableEvent; +import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiEventParam; +import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiCancelableEventParam; +import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiFogRenderParam; +import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiMutableFogRenderParam; +import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiRenderParam; +import com.seibel.distanthorizons.api.objects.data.IDhApiFullDataSource; +import com.seibel.distanthorizons.coreapi.util.ColorUtil; + +/** + * Fired before DH renders its fog. + * Canceling this event disables fog for that frame. + * + * @author James Seibel + * @version 2026-05-20 + * @since API 7.0.0 + */ +public abstract class DhApiBeforeFogRenderEvent implements IDhApiCancelableEvent +{ + /** Fired before fog is generated. */ + public abstract void beforeRender(DhApiCancelableEventParam event); + + + //=========================// + // internal DH API methods // + //=========================// + + @Override + public final void fireEvent(DhApiCancelableEventParam event) { this.beforeRender(event); } + + + + //==================// + // parameter object // + //==================// + + public static class EventParam implements IDhApiEventParam + { + private final DhApiRenderParam renderParam; + private final DhApiFogRenderParam originalFogRenderParam; + private final DhApiMutableFogRenderParam fogRenderParam; + + + + //=============// + // constructor // + //=============// + //region + + public EventParam(DhApiRenderParam renderParam, DhApiFogRenderParam fogRenderParam) + { + this.renderParam = renderParam; + this.originalFogRenderParam = fogRenderParam; + this.fogRenderParam = new DhApiMutableFogRenderParam(fogRenderParam); + } + + //endregion + + + + //=================// + // getters/setters // + //=================// + //region + + public DhApiRenderParam getRenderParam() { return this.renderParam; } + + /** immutable, stores what DH would do without API intervention so API users have a reference point */ + public DhApiFogRenderParam getOriginalFogRenderParam() { return this.originalFogRenderParam; } + /** mutable, can be modified by API users */ + public DhApiMutableFogRenderParam getFogRenderParam() { return this.fogRenderParam; } + + //endregion + + + + //==========================// + // base api event overrides // + //==========================// + //region + + /** + * Returns the same instance of this event. + * Copying this event isn't supported + * since the internal parameters must be mutated + * by API users in order to be tracked by DH's internal + * logic. + */ + @Override + public DhApiBeforeFogRenderEvent.EventParam copy() { return this; } + + @Override + public boolean getCopyBeforeFire() { return false; } + + //endregion + + + + } + + +} \ No newline at end of file diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiFogRenderParam.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiFogRenderParam.java new file mode 100644 index 000000000..fe1ed5fc8 --- /dev/null +++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiFogRenderParam.java @@ -0,0 +1,202 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.seibel.distanthorizons.api.methods.events.sharedParameterObjects; + +import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogFalloff; +import com.seibel.distanthorizons.api.enums.rendering.EDhApiHeightFogDirection; +import com.seibel.distanthorizons.api.enums.rendering.EDhApiHeightFogMixMode; +import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiFarFogConfig; +import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiFogConfig; +import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiHeightFogConfig; +import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiEventParam; + +import java.awt.*; + +/** + * Contains all the information needed to render Distant Horizons' fog. + * + * @see IDhApiFogConfig + * @see IDhApiFarFogConfig + * @see IDhApiHeightFogConfig + * + * @author James Seibel + * @version 2026-05-20 + * @since API 7.0.0 + */ +public class DhApiFogRenderParam implements IDhApiEventParam +{ + protected Color fogColor; + public Color getFogColor() { return this.fogColor; } + + // far fog // + //region + + protected EDhApiFogFalloff farFogFalloff; + /** @see IDhApiFarFogConfig#farFogFalloff() */ + public EDhApiFogFalloff getFarFogFalloff() { return this.farFogFalloff; } + + protected float farFogStartPercent; + /** @see IDhApiFarFogConfig#farFogStartDistance() */ + public float getFarFogStartPercent() { return this.farFogStartPercent; } + + protected float farFogEndPercent; + /** @see IDhApiFarFogConfig#farFogEndDistance() */ + public float getFarFogEndPercent() { return this.farFogEndPercent; } + + protected float farFogMinThickness; + /** @see IDhApiFarFogConfig#farFogMinThickness() */ + public float getFarFogMinThickness() { return this.farFogMinThickness; } + + protected float farFogMaxThickness; + /** @see IDhApiFarFogConfig#farFogMaxThickness() */ + public float getFarFogMaxThickness() { return this.farFogMaxThickness; } + + protected float farFogDensity; + /** @see IDhApiFarFogConfig#farFogDensity() */ + public float getFarFogDensity() { return this.farFogDensity; } + + //endregion + + // height fog // + //region + + protected EDhApiFogFalloff heightFogFalloff; + /** @see IDhApiHeightFogConfig#heightFogFalloff() */ + public EDhApiFogFalloff getHeightFogFalloff() { return this.heightFogFalloff; } + + protected EDhApiHeightFogMixMode heightFogMixingMode; + /** @see IDhApiHeightFogConfig#heightFogMixMode() */ + public EDhApiHeightFogMixMode getHeightFogMixingMode() { return this.heightFogMixingMode; } + + protected EDhApiHeightFogDirection heightFogDirection; + /** @see IDhApiHeightFogConfig#heightFogDirection() */ + public EDhApiHeightFogDirection getHeightFogDirection() { return this.heightFogDirection; } + + protected float heightFogBaseHeight; + /** @see IDhApiHeightFogConfig#heightFogBaseHeight() */ + public float getHeightFogBaseHeight() { return this.heightFogBaseHeight; } + + protected float heightFogStartPercent; + /** @see IDhApiHeightFogConfig#heightFogStartingHeightPercent() */ + public float getHeightFogStartPercent() { return this.heightFogStartPercent; } + + protected float heightFogEndPercent; + /** @see IDhApiHeightFogConfig#heightFogEndingHeightPercent() */ + public float getHeightFogEndPercent() { return this.heightFogEndPercent; } + + protected float heightFogMinThickness; + /** @see IDhApiHeightFogConfig#heightFogMinThickness() */ + public float getHeightFogMinThickness() { return this.heightFogMinThickness; } + + protected float heightFogMaxThickness; + /** @see IDhApiHeightFogConfig#heightFogMaxThickness() */ + public float getHeightFogMaxThickness() { return this.heightFogMaxThickness; } + + protected float heightFogDensity; + /** @see IDhApiHeightFogConfig#heightFogDensity() */ + public float getHeightFogDensity() { return this.heightFogDensity; } + + //endregion + + + + //==============// + // constructors // + //==============// + //region + + public DhApiFogRenderParam(DhApiFogRenderParam parent) + { + this( + parent.fogColor, + + // far fog + parent.farFogFalloff, + parent.farFogStartPercent, parent.farFogEndPercent, + parent.farFogMinThickness, parent.farFogEndPercent, + parent.farFogDensity, + + // height fog + parent.heightFogFalloff, + parent.heightFogMixingMode, parent.heightFogDirection, + parent.heightFogBaseHeight, + parent.heightFogStartPercent, parent.heightFogEndPercent, + parent.heightFogMinThickness, parent.heightFogMaxThickness, + parent.heightFogDensity + ); + } + public DhApiFogRenderParam( + Color fogColor, + + // far fog + EDhApiFogFalloff farFogFalloff, + float farFogStartPercent, float farFogEndPercent, + float farFogMinThickness, float farFogMaxThickness, + float farFogDensity, + + // height fog + EDhApiFogFalloff heightFogFalloff, + EDhApiHeightFogMixMode heightFogMixingMode, EDhApiHeightFogDirection heightFogDirection, + float heightFogBaseHeight, + float heightFogStartPercent, float heightFogEndPercent, + float heightFogMinThickness, float heightFogMaxThickness, + float heightFogDensity + ) + { + this.fogColor = fogColor; + + // far fog + this.farFogFalloff = farFogFalloff; + this.farFogStartPercent = farFogStartPercent; + this.farFogEndPercent = farFogEndPercent; + this.farFogMinThickness = farFogMinThickness; + this.farFogMaxThickness = farFogMaxThickness; + this.farFogDensity = farFogDensity; + + // height fog + this.heightFogFalloff = heightFogFalloff; + this.heightFogMixingMode = heightFogMixingMode; + this.heightFogDirection = heightFogDirection; + this.heightFogBaseHeight = heightFogBaseHeight; + this.heightFogStartPercent = heightFogStartPercent; + this.heightFogEndPercent = heightFogEndPercent; + this.heightFogMinThickness = heightFogMinThickness; + this.heightFogMaxThickness = heightFogMaxThickness; + this.heightFogDensity = heightFogDensity; + } + + //endregion + + + + //================// + // base overrides // + //================// + //region + + @Override + public DhApiFogRenderParam copy() { return new DhApiFogRenderParam(this); } + + //endregion + + + + +} diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiMutableFogRenderParam.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiMutableFogRenderParam.java new file mode 100644 index 000000000..ae5d79757 --- /dev/null +++ b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/sharedParameterObjects/DhApiMutableFogRenderParam.java @@ -0,0 +1,117 @@ +/* + * This file is part of the Distant Horizons mod + * licensed under the GNU LGPL v3 License. + * + * Copyright (C) 2020 James Seibel + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.seibel.distanthorizons.api.methods.events.sharedParameterObjects; + +import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogFalloff; +import com.seibel.distanthorizons.api.enums.rendering.EDhApiHeightFogDirection; +import com.seibel.distanthorizons.api.enums.rendering.EDhApiHeightFogMixMode; +import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiFarFogConfig; +import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiFogConfig; +import com.seibel.distanthorizons.api.interfaces.config.client.IDhApiHeightFogConfig; + +import java.awt.*; + +/** + * A mutable version of {@link DhApiFogRenderParam} to allow + * API modification of DH's fog rendering. + * + * @see IDhApiFogConfig + * @see IDhApiFarFogConfig + * @see IDhApiHeightFogConfig + * @see DhApiFogRenderParam + * + * @author James Seibel + * @version 2026-05-20 + * @since API 7.0.0 + */ +public class DhApiMutableFogRenderParam extends DhApiFogRenderParam +{ + public void setFogColor(Color fogColor) { this.fogColor = fogColor; } + + // far fog // + //region + + /** @see IDhApiFarFogConfig#farFogFalloff() */ + public void setFarFogFalloff(EDhApiFogFalloff farFogFalloff) { this.farFogFalloff = farFogFalloff; } + /** @see IDhApiFarFogConfig#farFogStartDistance() */ + public void setFarFogStartPercent(float farFogStartPercent) { this.farFogStartPercent = farFogStartPercent; } + /** @see IDhApiFarFogConfig#farFogEndDistance() */ + public void setFarFogEndPercent(float farFogEndPercent) { this.farFogEndPercent = farFogEndPercent; } + /** @see IDhApiFarFogConfig#farFogMinThickness() */ + public void setFarFogMinThickness(float farFogMinThickness) { this.farFogMinThickness = farFogMinThickness; } + /** @see IDhApiFarFogConfig#farFogMaxThickness() */ + public void setFarFogMaxThickness(float farFogMaxThickness) { this.farFogMaxThickness = farFogMaxThickness; } + /** @see IDhApiFarFogConfig#farFogDensity() */ + public void setFarFogDensity(float farFogDensity) { this.farFogDensity = farFogDensity; } + + //endregion + + // height fog // + //region + + /** @see IDhApiHeightFogConfig#heightFogFalloff() */ + public void setHeightFogFalloff(EDhApiFogFalloff heightFogFalloff) { this.heightFogFalloff = heightFogFalloff; } + /** @see IDhApiHeightFogConfig#heightFogMixMode() */ + public void setHeightFogMixingMode(EDhApiHeightFogMixMode heightFogMixingMode) { this.heightFogMixingMode = heightFogMixingMode; } + /** @see IDhApiHeightFogConfig#heightFogDirection() */ + public void setHeightFogDirection(EDhApiHeightFogDirection heightFogDirection) { this.heightFogDirection = heightFogDirection; } + /** @see IDhApiHeightFogConfig#heightFogBaseHeight() */ + public void setHeightFogBaseHeight(float heightFogBaseHeight) { this.heightFogBaseHeight = heightFogBaseHeight; } + /** @see IDhApiHeightFogConfig#heightFogStartingHeightPercent() */ + public void setHeightFogStartPercent(float heightFogStartPercent) { this.heightFogStartPercent = heightFogStartPercent; } + /** @see IDhApiHeightFogConfig#heightFogEndingHeightPercent() */ + public void setHeightFogEndPercent(float heightFogEnd) { this.heightFogEndPercent = heightFogEnd; } + /** @see IDhApiHeightFogConfig#heightFogMinThickness() */ + public void setHeightFogMinThickness(float heightFogMinThickness) { this.heightFogMinThickness = heightFogMinThickness; } + /** @see IDhApiHeightFogConfig#heightFogMaxThickness() */ + public void setHeightFogMaxThickness(float heightFogMaxThickness) { this.heightFogMaxThickness = heightFogMaxThickness; } + /** @see IDhApiHeightFogConfig#heightFogDensity() */ + public void setHeightFogDensity(float heightFogDensity) { this.heightFogDensity = heightFogDensity; } + + //endregion + + + + //==============// + // constructors // + //==============// + //region + + public DhApiMutableFogRenderParam(DhApiFogRenderParam parent) + { super(parent); } + + //endregion + + + + //================// + // base overrides // + //================// + //region + + @Override + public DhApiMutableFogRenderParam copy() { return new DhApiMutableFogRenderParam(this); } + + //endregion + + + + +} diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/FogRenderParamFactory.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/FogRenderParamFactory.java new file mode 100644 index 000000000..adbc92a67 --- /dev/null +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/FogRenderParamFactory.java @@ -0,0 +1,99 @@ +package com.seibel.distanthorizons.core.render.renderer; + +import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogColorMode; +import com.seibel.distanthorizons.api.enums.rendering.EDhApiFogFalloff; +import com.seibel.distanthorizons.api.enums.rendering.EDhApiHeightFogDirection; +import com.seibel.distanthorizons.api.enums.rendering.EDhApiHeightFogMixMode; +import com.seibel.distanthorizons.api.methods.events.abstractEvents.DhApiBeforeFogRenderEvent; +import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiFogRenderParam; +import com.seibel.distanthorizons.core.config.Config; +import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector; +import com.seibel.distanthorizons.core.render.RenderParams; +import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftRenderWrapper; + +import java.awt.*; + +/** + * @see DhApiFogRenderParam + * @see DhApiBeforeFogRenderEvent.EventParam + */ +public class FogRenderParamFactory +{ + private static final IMinecraftRenderWrapper MC_RENDER = SingletonInjector.INSTANCE.get(IMinecraftRenderWrapper.class); + + + + public static DhApiBeforeFogRenderEvent.EventParam createRenderParam(RenderParams renderParams) + { + Color fogColor = getFogColor(renderParams.partialTicks); + + // far fog + EDhApiFogFalloff farFogFalloff = Config.Client.Advanced.Graphics.Fog.farFogFalloff.get(); + float farFogStart = Config.Client.Advanced.Graphics.Fog.farFogStart.get(); + float farFogEnd = Config.Client.Advanced.Graphics.Fog.farFogEnd.get(); + float farFogMin = Config.Client.Advanced.Graphics.Fog.farFogMin.get(); + float farFogMax = Config.Client.Advanced.Graphics.Fog.farFogMax.get(); + float farFogDensity = Config.Client.Advanced.Graphics.Fog.farFogDensity.get(); + + + // height fog + EDhApiFogFalloff heightFogFalloff = Config.Client.Advanced.Graphics.Fog.HeightFog.heightFogFalloff.get(); + EDhApiHeightFogMixMode heightFogMixingMode = Config.Client.Advanced.Graphics.Fog.HeightFog.heightFogMixMode.get(); + EDhApiHeightFogDirection heightFogCameraDirection = Config.Client.Advanced.Graphics.Fog.HeightFog.heightFogDirection.get(); + + float heightFogBaseHeight = Config.Client.Advanced.Graphics.Fog.HeightFog.heightFogBaseHeight.get(); + float heightFogStart = Config.Client.Advanced.Graphics.Fog.HeightFog.heightFogStart.get(); + float heightFogEnd = Config.Client.Advanced.Graphics.Fog.HeightFog.heightFogEnd.get(); + float heightFogMin = Config.Client.Advanced.Graphics.Fog.HeightFog.heightFogMin.get(); + float heightFogMax = Config.Client.Advanced.Graphics.Fog.HeightFog.heightFogMax.get(); + float heightFogDensity = Config.Client.Advanced.Graphics.Fog.HeightFog.heightFogDensity.get(); + + // override fog if underwater + if (MC_RENDER.isFogStateSpecial()) + { + // hide everything behind fog + farFogStart = 0.0f; + farFogEnd = 0.0f; + } + + DhApiFogRenderParam fogRenderParam = new DhApiFogRenderParam( + fogColor, + + // far fog + farFogFalloff, + farFogStart, farFogEnd, + farFogMin, farFogMax, + farFogDensity, + + // height fog + heightFogFalloff, + heightFogMixingMode, heightFogCameraDirection, + heightFogBaseHeight, + heightFogStart, heightFogEnd, + heightFogMin, heightFogMax, + heightFogDensity + ); + + DhApiBeforeFogRenderEvent.EventParam fogRenderEventParam = new DhApiBeforeFogRenderEvent.EventParam(renderParams, fogRenderParam); + return fogRenderEventParam; + } + + private static Color getFogColor(float partialTicks) + { + Color fogColor; + + if (Config.Client.Advanced.Graphics.Fog.colorMode.get() == EDhApiFogColorMode.USE_SKY_COLOR) + { + fogColor = MC_RENDER.getSkyColor(); + } + else + { + fogColor = MC_RENDER.getFogColor(partialTicks); + } + + return fogColor; + } + + + +} diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java index fbddcb82f..a9c7c6662 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java @@ -21,6 +21,7 @@ package com.seibel.distanthorizons.core.render.renderer; import com.seibel.distanthorizons.api.enums.rendering.EDhApiTransparency; import com.seibel.distanthorizons.api.methods.events.abstractEvents.*; +import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiFogRenderParam; import com.seibel.distanthorizons.core.config.Config; import com.seibel.distanthorizons.core.dataObjects.render.bufferBuilding.LodBufferContainer; import com.seibel.distanthorizons.core.dependencyInjection.ModAccessorInjector; @@ -118,9 +119,9 @@ public class LodRenderer private void renderTerrain(RenderParams renderParams, IProfilerWrapper profiler, boolean runningDeferredPass) { - //====================// // validate rendering // //====================// + //====================// //region boolean deferTransparentRendering = DhApiRenderProxy.INSTANCE.getDeferTransparentRendering(); @@ -202,6 +203,8 @@ public class LodRenderer renderFog |= renderParams.vanillaFogEnabled; } + DhApiBeforeFogRenderEvent.EventParam fogRenderEventParam = FogRenderParamFactory.createRenderParam(renderParams); + //endregion @@ -270,11 +273,13 @@ public class LodRenderer // fog - if (renderFog) + boolean cancelFogEvent = ApiEventInjector.INSTANCE.fireAllEvents(DhApiBeforeFogRenderEvent.class, fogRenderEventParam); + if (renderFog + && !cancelFogEvent) { profiler.popPush("LOD Fog"); - this.fogRenderer.render(renderParams); + this.fogRenderer.render(renderParams, fogRenderEventParam.getFogRenderParam()); } @@ -333,11 +338,13 @@ public class LodRenderer this.renderTerrain(this.terrainRenderer, renderBufferHandler, renderParams, /*opaquePass*/ false, profiler); - if (renderFog) + boolean cancelFogEvent = ApiEventInjector.INSTANCE.fireAllEvents(DhApiBeforeFogRenderEvent.class, fogRenderEventParam); + if (renderFog + && !cancelFogEvent) { profiler.popPush("LOD Fog"); - this.fogRenderer.render(renderParams); + this.fogRenderer.render(renderParams, fogRenderEventParam.getFogRenderParam()); } } } diff --git a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/render/renderPass/IDhFogRenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/render/renderPass/IDhFogRenderer.java index f3420ab9a..8e7514700 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/render/renderPass/IDhFogRenderer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/wrapperInterfaces/render/renderPass/IDhFogRenderer.java @@ -19,12 +19,13 @@ package com.seibel.distanthorizons.core.wrapperInterfaces.render.renderPass; +import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiFogRenderParam; import com.seibel.distanthorizons.core.render.RenderParams; import com.seibel.distanthorizons.coreapi.interfaces.dependencyInjection.IBindable; public interface IDhFogRenderer extends IBindable { - void render(RenderParams renderParams); + void render(RenderParams renderParams, DhApiFogRenderParam fogRenderParams); }