Class ViewportEvent.RenderFog
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ViewportEvent
net.neoforged.neoforge.client.event.ViewportEvent.RenderFog
- Enclosing class:
ViewportEvent
Fired for rendering custom fog. The plane distances are based on the player's render distance.
This event is fired on the main Forge event bus, only on the logical client.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.client.event.ViewportEvent
ViewportEvent.ComputeCameraAngles, ViewportEvent.ComputeFogColor, ViewportEvent.ComputeFov, ViewportEvent.RenderFog
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable FogEnvironment
private final FogData
private final FogType
-
Constructor Summary
ConstructorsConstructorDescriptionRenderFog
(@Nullable FogEnvironment environment, FogType type, Camera camera, float partialTicks, FogData fogData) -
Method Summary
Modifier and TypeMethodDescription@Nullable FogEnvironment
Returns the fog environment that was applied.float
Returns the distance to the far plane where the fog ends.The fog parameters that are passed to the shaders.float
Returns the distance to the near plane where the fog starts.getType()
Returns the type of fog being rendered.void
scaleFarPlaneDistance
(float factor) Scales the distance to the far plane of the fog by a given factor.void
scaleNearPlaneDistance
(float factor) Scales the distance to the near plane of the fog by a given factor.void
setFarPlaneDistance
(float distance) Sets the distance to the far plane of the fog.void
setNearPlaneDistance
(float distance) Sets the distance to the near plane of the fog.Methods inherited from class net.neoforged.neoforge.client.event.ViewportEvent
getCamera, getPartialTick, getRenderer
-
Field Details
-
environment
-
type
-
fogData
-
-
Constructor Details
-
RenderFog
@Internal public RenderFog(@Nullable @Nullable FogEnvironment environment, FogType type, Camera camera, float partialTicks, FogData fogData)
-
-
Method Details
-
getEnvironment
Returns the fog environment that was applied.- Returns:
- the fog environment that was applied
-
getType
Returns the type of fog being rendered.- Returns:
- the type of fog being rendered
-
getFarPlaneDistance
public float getFarPlaneDistance()Returns the distance to the far plane where the fog ends.- Returns:
- the distance to the far plane where the fog ends
-
getNearPlaneDistance
public float getNearPlaneDistance()Returns the distance to the near plane where the fog starts.- Returns:
- the distance to the near plane where the fog starts
-
getFogData
The fog parameters that are passed to the shaders. This object is mutable. -
setFarPlaneDistance
public void setFarPlaneDistance(float distance) Sets the distance to the far plane of the fog.- Parameters:
distance
- the new distance to the far place- See Also:
-
setNearPlaneDistance
public void setNearPlaneDistance(float distance) Sets the distance to the near plane of the fog.- Parameters:
distance
- the new distance to the near plane- See Also:
-
scaleFarPlaneDistance
public void scaleFarPlaneDistance(float factor) Scales the distance to the far plane of the fog by a given factor.- Parameters:
factor
- the factor to scale the far plane distance by
-
scaleNearPlaneDistance
public void scaleNearPlaneDistance(float factor) Scales the distance to the near plane of the fog by a given factor.- Parameters:
factor
- the factor to scale the near plane distance by
-