Class LightScatteringFilter

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

public class LightScatteringFilter extends com.jme3.post.Filter
LightScattering filters create rays coming from light sources This is often referred to as god rays.
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 lightScattering filter
    LightScatteringFilter(com.jme3.math.Vector3f lightPosition)
    Creates a lightScatteringFilter
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    returns the blur start of the scattering see setBlurStart(float blurStart)
    float
    returns the blur width
    see setBlurWidth(float blurWidth)
    float
    returns the light density see setLightDensity(float lightDensity)
    com.jme3.math.Vector3f
    returns the light position
    protected com.jme3.material.Material
     
    int
    returns the number of samples for the radial blur
    protected void
    initFilter(com.jme3.asset.AssetManager manager, com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort vp, int w, int h)
     
    protected boolean
     
    protected void
    postQueue(com.jme3.renderer.queue.RenderQueue queue)
     
    void
    read(com.jme3.export.JmeImporter im)
     
    void
    setBlurStart(float blurStart)
    sets the blur start
    at which distance from the light source the effect starts default is 0.02
    void
    setBlurWidth(float blurWidth)
    sets the blur width default is 0.9
    void
    setLightDensity(float lightDensity)
    sets how much the effect is visible over the rendered scene default is 1.4
    void
    setLightPosition(com.jme3.math.Vector3f lightPosition)
    sets the light position
    void
    setNbSamples(int nbSamples)
    sets the number of samples for the radial blur default is 50 the higher the value the higher the quality, but the slower the performance.
    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, 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

    • LightScatteringFilter

      public LightScatteringFilter()
      creates a lightScattering filter
    • LightScatteringFilter

      public LightScatteringFilter(com.jme3.math.Vector3f lightPosition)
      Creates a lightScatteringFilter
      Parameters:
      lightPosition - the desired location (in world coordinates, alias created)
  • Method Details

    • isRequiresDepthTexture

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

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

      protected void postQueue(com.jme3.renderer.queue.RenderQueue queue)
      Overrides:
      postQueue 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
    • getBlurStart

      public float getBlurStart()
      returns the blur start of the scattering see setBlurStart(float blurStart)
      Returns:
      the start distance
    • setBlurStart

      public void setBlurStart(float blurStart)
      sets the blur start
      at which distance from the light source the effect starts default is 0.02
      Parameters:
      blurStart - the desired start distance (in world units, default=0.02)
    • getBlurWidth

      public float getBlurWidth()
      returns the blur width
      see setBlurWidth(float blurWidth)
      Returns:
      the width
    • setBlurWidth

      public void setBlurWidth(float blurWidth)
      sets the blur width default is 0.9
      Parameters:
      blurWidth - the desired width (default=0.9)
    • getLightDensity

      public float getLightDensity()
      returns the light density see setLightDensity(float lightDensity)
      Returns:
      the density
    • setLightDensity

      public void setLightDensity(float lightDensity)
      sets how much the effect is visible over the rendered scene default is 1.4
      Parameters:
      lightDensity - the desired density (default=1.4)
    • getLightPosition

      public com.jme3.math.Vector3f getLightPosition()
      returns the light position
      Returns:
      the pre-existing vector
    • setLightPosition

      public void setLightPosition(com.jme3.math.Vector3f lightPosition)
      sets the light position
      Parameters:
      lightPosition - the desired location (in world coordinates, alias created)
    • getNbSamples

      public int getNbSamples()
      returns the number of samples for the radial blur
      Returns:
      count (≥0)
    • setNbSamples

      public void setNbSamples(int nbSamples)
      sets the number of samples for the radial blur default is 50 the higher the value the higher the quality, but the slower the performance.
      Parameters:
      nbSamples - the desired number of samples (default=50)
    • 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