Class FogFilter

java.lang.Object
com.jme3.post.Filter
com.jme3.post.filters.FogFilter
All Implemented Interfaces:
com.jme3.export.Savable

public class FogFilter extends com.jme3.post.Filter
A filter to render a fog effect
Author:
Rémy Bouquet aka Nehon
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.jme3.post.Filter

    com.jme3.post.Filter.Pass
  • Field Summary

    Fields inherited from class com.jme3.post.Filter

    defaultPass, enabled, material, postRenderPasses, processor
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a FogFilter
    FogFilter(com.jme3.math.ColorRGBA fogColor, float fogDensity, float fogDistance)
    Create a fog filter
  • Method Summary

    Modifier and Type
    Method
    Description
    com.jme3.math.ColorRGBA
    returns the fog color
    float
    returns the fog density
    float
    returns the fog distance
    protected com.jme3.material.Material
     
    protected void
    initFilter(com.jme3.asset.AssetManager manager, com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort vp, int w, int h)
     
    protected boolean
     
    void
    read(com.jme3.export.JmeImporter im)
     
    void
    setFogColor(com.jme3.math.ColorRGBA fogColor)
    Sets the color of the fog
    void
    setFogDensity(float fogDensity)
    Sets the density of the fog, a high value gives a thick fog
    void
    setFogDistance(float fogDistance)
    the distance of the fog.
    void
    write(com.jme3.export.JmeExporter ex)
     

    Methods inherited from class com.jme3.post.Filter

    cleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, postFrame, postQueue, preFrame, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FogFilter

      public FogFilter()
      Creates a FogFilter
    • FogFilter

      public FogFilter(com.jme3.math.ColorRGBA fogColor, float fogDensity, float fogDistance)
      Create a fog filter
      Parameters:
      fogColor - the color of the fog (default is white)
      fogDensity - the density of the fog (default is 0.7)
      fogDistance - the distance of the fog (default is 1000)
  • Method Details

    • isRequiresDepthTexture

      protected boolean isRequiresDepthTexture()
      Overrides:
      isRequiresDepthTexture in class com.jme3.post.Filter
    • initFilter

      protected void initFilter(com.jme3.asset.AssetManager manager, com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort vp, int w, int h)
      Specified by:
      initFilter in class com.jme3.post.Filter
    • getMaterial

      protected com.jme3.material.Material getMaterial()
      Specified by:
      getMaterial in class com.jme3.post.Filter
    • getFogColor

      public com.jme3.math.ColorRGBA getFogColor()
      returns the fog color
      Returns:
      the pre-existing instance
    • setFogColor

      public void setFogColor(com.jme3.math.ColorRGBA fogColor)
      Sets the color of the fog
      Parameters:
      fogColor - the desired color (alias created, default=(1,1,1,1))
    • getFogDensity

      public float getFogDensity()
      returns the fog density
      Returns:
      the density value
    • setFogDensity

      public void setFogDensity(float fogDensity)
      Sets the density of the fog, a high value gives a thick fog
      Parameters:
      fogDensity - the desired density (default=0.7)
    • getFogDistance

      public float getFogDistance()
      returns the fog distance
      Returns:
      the distance
    • setFogDistance

      public void setFogDistance(float fogDistance)
      the distance of the fog. the higher the value the distant the fog looks
      Parameters:
      fogDistance - the desired distance (in world units, default=1000)
    • write

      public void write(com.jme3.export.JmeExporter ex) throws IOException
      Specified by:
      write in interface com.jme3.export.Savable
      Overrides:
      write in class com.jme3.post.Filter
      Throws:
      IOException
    • read

      public void read(com.jme3.export.JmeImporter im) throws IOException
      Specified by:
      read in interface com.jme3.export.Savable
      Overrides:
      read in class com.jme3.post.Filter
      Throws:
      IOException