Class FogEffect


  • public class FogEffect
    extends PostProcessingEffect
    Fog effect for the post processer
    Author:
    Darius Dinger
    • Constructor Detail

      • FogEffect

        public FogEffect()
        Creating new fog effect
    • Method Detail

      • setDensity

        public void setDensity​(float density)
        Setting fogs density. Fog visibility will be calculated by this formula:
        f(x) = e^-(density * x)^gradient
        Parameters:
        density - Fogs new density
      • setGradient

        public void setGradient​(float gradient)
        Setting fogs gradient. Fog visibility will be calculated by this formula:
        f(x) = e^-(density * x)^gradient
        Parameters:
        gradient - Fogs new gradient
      • getColor

        public Color getColor()
        Returns:
        Color of the fog
      • getDensity

        public float getDensity()
        Getting fogs density. Fog visibility will be calculated by this formula:
        f(x) = e^-(density * x)^gradient
        Returns:
        Fogs density
      • getGradient

        public float getGradient()
        Getting fogs gradient. Fog visibility will be calculated by this formula:
        f(x) = e^-(density * x)^gradient
        Returns:
        Fogs gradient
      • setBlending

        public void setBlending​(boolean blending)
        Enable or disable blending. When enabled the fog will blend into the background. For example skybox.
        Parameters:
        blending - New blending status