Class SSAOFilter

java.lang.Object
com.jme3.post.Filter
com.jme3.post.ssao.SSAOFilter
All Implemented Interfaces:
com.jme3.export.Savable

public class SSAOFilter extends com.jme3.post.Filter
SSAO stands for screen space ambient occlusion It's a technique that fakes ambient lighting by computing shadows that nearby objects would cast on each other. under the effect of an ambient light more info on this in this blog post http://jmonkeyengine.org/2010/08/16/screen-space-ambient-occlusion-for-jmonkeyengine-3-0/
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
    Create a Screen Space Ambient Occlusion Filter
    SSAOFilter(float sampleRadius, float intensity, float scale, float bias)
    Create a Screen Space Ambient Occlusion Filter
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    cleanUpFilter(com.jme3.renderer.Renderer r)
     
    float
    Return the bias
    see setBias(float bias)
    float
    returns the ambient occlusion intensity
    protected com.jme3.material.Material
     
    float
    returns the sample radius
    see {link setSampleRadius(float sampleRadius)}
    float
    returns the scale
    see setScale(float scale)
    protected void
    initFilter(com.jme3.asset.AssetManager manager, com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort vp, int w, int h)
     
    boolean
     
    protected boolean
     
    boolean
    debugging only , will be removed
    boolean
    debugging only , will be removed
    protected void
    postQueue(com.jme3.renderer.queue.RenderQueue queue)
     
    void
    read(com.jme3.export.JmeImporter im)
     
    void
    setApproximateNormals(boolean approximateNormals)
     
    void
    setBias(float bias)
    Sets the width of the occlusion cone considered by the occludee default is 0.1f
    void
    setIntensity(float intensity)
    Sets the Ambient occlusion intensity default is 1.5
    void
    setSampleRadius(float sampleRadius)
    Sets the radius of the area where random samples will be picked default 5.1f
    void
    setScale(float scale)
    Returns the distance between occluders and occludee.
    void
    setUseAo(boolean useAo)
    debugging only , will be removed
    void
    setUseOnlyAo(boolean useOnlyAo)
    debugging only , will be removed
    void
    write(com.jme3.export.JmeExporter ex)
     

    Methods inherited from class com.jme3.post.Filter

    cleanup, 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

    • SSAOFilter

      public SSAOFilter()
      Create a Screen Space Ambient Occlusion Filter
    • SSAOFilter

      public SSAOFilter(float sampleRadius, float intensity, float scale, float bias)
      Create a Screen Space Ambient Occlusion Filter
      Parameters:
      sampleRadius - The radius of the area where random samples will be picked. default 5.1f
      intensity - intensity of the resulting AO. default 1.2f
      scale - distance between occluders and occludee. default 0.2f
      bias - the width of the occlusion cone considered by the occludee. default 0.1f
  • Method Details

    • isRequiresDepthTexture

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

      protected void postQueue(com.jme3.renderer.queue.RenderQueue queue)
      Overrides:
      postQueue in class com.jme3.post.Filter
    • getMaterial

      protected com.jme3.material.Material getMaterial()
      Specified by:
      getMaterial 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
    • cleanUpFilter

      protected void cleanUpFilter(com.jme3.renderer.Renderer r)
      Overrides:
      cleanUpFilter in class com.jme3.post.Filter
    • getBias

      public float getBias()
      Return the bias
      see setBias(float bias)
      Returns:
      bias
    • setBias

      public void setBias(float bias)
      Sets the width of the occlusion cone considered by the occludee default is 0.1f
      Parameters:
      bias - the desired width (default=0.1)
    • getIntensity

      public float getIntensity()
      returns the ambient occlusion intensity
      Returns:
      intensity
    • setIntensity

      public void setIntensity(float intensity)
      Sets the Ambient occlusion intensity default is 1.5
      Parameters:
      intensity - the desired intensity (default=1.5)
    • getSampleRadius

      public float getSampleRadius()
      returns the sample radius
      see {link setSampleRadius(float sampleRadius)}
      Returns:
      the sample radius
    • setSampleRadius

      public void setSampleRadius(float sampleRadius)
      Sets the radius of the area where random samples will be picked default 5.1f
      Parameters:
      sampleRadius - the desired radius (default=5.1)
    • getScale

      public float getScale()
      returns the scale
      see setScale(float scale)
      Returns:
      scale
    • setScale

      public void setScale(float scale)
      Returns the distance between occluders and occludee. default 0.2f
      Parameters:
      scale - the desired distance (default=0.2)
    • isUseAo

      public boolean isUseAo()
      debugging only , will be removed
      Returns:
      true if using ambient occlusion
    • setUseAo

      public void setUseAo(boolean useAo)
      debugging only , will be removed
      Parameters:
      useAo - true to enable, false to disable (default=true)
    • setApproximateNormals

      public void setApproximateNormals(boolean approximateNormals)
    • isApproximateNormals

      public boolean isApproximateNormals()
    • isUseOnlyAo

      public boolean isUseOnlyAo()
      debugging only , will be removed
      Returns:
      useOnlyAo
    • setUseOnlyAo

      public void setUseOnlyAo(boolean useOnlyAo)
      debugging only , will be removed
      Parameters:
      useOnlyAo - true to enable, false to disable (default=false)
    • 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