com.jme3.post.ssao
Class SSAOFilter

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

public class SSAOFilter
extends Filter

SSAO stands for screen space ambient occlusion It's a technique that fake ambient lighting by computing shadows that near by objects would casts on each others 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/


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme3.post.Filter
Filter.Pass
 
Field Summary
 
Fields inherited from class com.jme3.post.Filter
defaultPass, enabled, material, postRenderPasses, processor
 
Constructor Summary
SSAOFilter()
          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
 float getBias()
          Return the bias
see setBias(float bias)
 float getIntensity()
          returns the ambient occlusion intensity
protected  Material getMaterial()
          Must return the material used for this filter.
 float getSampleRadius()
          returns the sample radius
see {link setSampleRadius(float sampleRadius)}
 float getScale()
          returns the scale
see setScale(float scale)
protected  void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h)
          Initialization of sub classes filters This method is called once when the filter is added to the FilterPostProcessor It should contain Material initializations and extra passes initialization
protected  boolean isRequiresDepthTexture()
          Override this method and return true if your Filter needs the depth texture
 boolean isUseAo()
          debugging only , will be removed
 boolean isUseOnlyAo()
          debugging only , will be removed
protected  void postQueue(RenderManager renderManager, ViewPort viewPort)
          Override this method if you want to make a pre pass, before the actual rendering of the frame
 void read(JmeImporter im)
          Override this method if you want to load extra properties when the filter is loaded else only basic properties of the filter will be loaded This method should always begin by super.read(im);
 void setBias(float bias)
          Sets the 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.2f
 void setSampleRadius(float sampleRadius)
          Sets the radius of the area where random samples will be picked dafault 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(JmeExporter ex)
          Override this method if you want to save extra properties when the filter is saved else only basic properties of the filter will be saved This method should always begin by super.write(ex);
 
Methods inherited from class com.jme3.post.Filter
cleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresSceneTexture, 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 Detail

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 Detail

isRequiresDepthTexture

protected boolean isRequiresDepthTexture()
Description copied from class: Filter
Override this method and return true if your Filter needs the depth texture

Overrides:
isRequiresDepthTexture in class Filter
Returns:
true if your Filter need the depth texture

postQueue

protected void postQueue(RenderManager renderManager,
                         ViewPort viewPort)
Description copied from class: Filter
Override this method if you want to make a pre pass, before the actual rendering of the frame

Overrides:
postQueue in class Filter

getMaterial

protected Material getMaterial()
Description copied from class: Filter
Must return the material used for this filter. this method is called every frame.

Specified by:
getMaterial in class Filter
Returns:
the material used for this filter.

initFilter

protected void initFilter(AssetManager manager,
                          RenderManager renderManager,
                          ViewPort vp,
                          int w,
                          int h)
Description copied from class: Filter
Initialization of sub classes filters This method is called once when the filter is added to the FilterPostProcessor It should contain Material initializations and extra passes initialization

Specified by:
initFilter in class Filter
Parameters:
manager - the assetManager
renderManager - the renderManager
vp - the viewPort where this filter is rendered
w - the width of the filter
h - the height of the filter

getBias

public float getBias()
Return the bias
see setBias(float bias)

Returns:
bias

setBias

public void setBias(float bias)
Sets the the width of the occlusion cone considered by the occludee default is 0.1f

Parameters:
bias -

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.2f

Parameters:
intensity -

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 dafault 5.1f

Parameters:
sampleRadius -

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 -

isUseAo

public boolean isUseAo()
debugging only , will be removed

Returns:
Whether or not

setUseAo

public void setUseAo(boolean useAo)
debugging only , will be removed


isUseOnlyAo

public boolean isUseOnlyAo()
debugging only , will be removed

Returns:
useOnlyAo

setUseOnlyAo

public void setUseOnlyAo(boolean useOnlyAo)
debugging only , will be removed


write

public void write(JmeExporter ex)
           throws java.io.IOException
Description copied from class: Filter
Override this method if you want to save extra properties when the filter is saved else only basic properties of the filter will be saved This method should always begin by super.write(ex);

Specified by:
write in interface Savable
Overrides:
write in class Filter
Throws:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
Description copied from class: Filter
Override this method if you want to load extra properties when the filter is loaded else only basic properties of the filter will be loaded This method should always begin by super.read(im);

Specified by:
read in interface Savable
Overrides:
read in class Filter
Throws:
java.io.IOException