public class SSAOFilter extends Filter
Filter.Pass
defaultPass, enabled, material, postRenderPasses, processor
Constructor and Description |
---|
SSAOFilter()
Create a Screen Space Ambient Occlusion Filter
|
SSAOFilter(float sampleRadius,
float intensity,
float scale,
float bias)
Create a Screen Space Ambient Occlusion Filter
|
Modifier and Type | Method and Description |
---|---|
protected void |
cleanUpFilter(Renderer r)
override this method if you have some cleanup to do
|
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 filter subclasses.
|
boolean |
isApproximateNormals() |
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(RenderQueue queue)
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 |
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(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);
|
cleanup, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, postFrame, preFrame, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
public SSAOFilter()
public SSAOFilter(float sampleRadius, float intensity, float scale, float bias)
sampleRadius
- The radius of the area where random samples will be picked. default 5.1fintensity
- intensity of the resulting AO. default 1.2fscale
- distance between occluders and occludee. default 0.2fbias
- the width of the occlusion cone considered by the occludee. default 0.1fprotected boolean isRequiresDepthTexture()
Filter
isRequiresDepthTexture
in class Filter
protected void postQueue(RenderQueue queue)
Filter
protected Material getMaterial()
Filter
getMaterial
in class Filter
protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h)
Filter
initFilter
in class Filter
manager
- the assetManagerrenderManager
- the renderManagervp
- the viewPort where this filter is renderedw
- the width of the filterh
- the height of the filterprotected void cleanUpFilter(Renderer r)
Filter
cleanUpFilter
in class Filter
r
- the rendererpublic float getBias()
setBias(float bias)
public void setBias(float bias)
bias
- the desired width (default=0.1)public float getIntensity()
public void setIntensity(float intensity)
intensity
- the desired intensity (default=1.5)public float getSampleRadius()
public void setSampleRadius(float sampleRadius)
sampleRadius
- the desired radius (default=5.1)public float getScale()
setScale(float scale)
public void setScale(float scale)
scale
- the desired distance (default=0.2)public boolean isUseAo()
public void setUseAo(boolean useAo)
useAo
- true to enable, false to disable (default=true)public void setApproximateNormals(boolean approximateNormals)
public boolean isApproximateNormals()
public boolean isUseOnlyAo()
public void setUseOnlyAo(boolean useOnlyAo)
useOnlyAo
- true to enable, false to disable (default=false)public void write(JmeExporter ex) throws java.io.IOException
Filter
public void read(JmeImporter im) throws java.io.IOException
Filter