Filter.Pass
defaultPass, enabled, material, postRenderPasses, processor
Constructor and Description |
---|
DepthOfFieldFilter()
Creates a DepthOfField filter
|
Modifier and Type | Method and Description |
---|---|
float |
getBlurScale()
returns the blur scale
|
float |
getBlurThreshold()
returns the blur threshold.
|
boolean |
getDebugUnfocus() |
float |
getFocusDistance()
returns the focus distance
|
float |
getFocusRange()
returns the focus range
|
protected Material |
getMaterial()
Must return the material used for this filter.
|
protected void |
initFilter(AssetManager assets,
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
|
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 |
setBlurScale(float f)
Sets the blur amount by scaling the convolution filter up or
down.
|
void |
setBlurThreshold(float f)
Sets the minimum blur factor before the convolution filter is
calculated.
|
void |
setDebugUnfocus(boolean b)
Turns on/off debugging of the 'unfocus' value that is used to
mix the convolution filter.
|
void |
setFocusDistance(float f)
Sets the distance at which objects are purely in focus.
|
void |
setFocusRange(float f)
Sets the range to either side of focusDistance where the
objects go gradually out of focus.
|
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, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, postFrame, postQueue, preFrame, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
protected boolean isRequiresDepthTexture()
Filter
isRequiresDepthTexture
in class Filter
protected Material getMaterial()
Filter
getMaterial
in class Filter
protected void initFilter(AssetManager assets, RenderManager renderManager, ViewPort vp, int w, int h)
Filter
initFilter
in class Filter
assets
- the assetManagerrenderManager
- the renderManagervp
- the viewPort where this filter is renderedw
- the width of the filterh
- the height of the filterpublic void setFocusDistance(float f)
f
- the desired distance (in world units, default=50)public float getFocusDistance()
public void setFocusRange(float f)
f
- the desired half extent (in world units, default=10)public float getFocusRange()
public void setBlurScale(float f)
f
- the desired filter scale (default=1)public float getBlurScale()
public void setBlurThreshold(float f)
In scenes where the focus distance is close (like 0) and the focus range is relatively large, this threshold will remove some subtlety in the near-camera blurring and should be set smaller than the default or to 0 to disable completely. Sometimes that cut-off is desired if mid-to-far field unfocusing is all that is desired.
f
- the desired blur factor (default=0.2)public float getBlurThreshold()
public void setDebugUnfocus(boolean b)
b
- true to enable debugging, false to disable it (default=false)public boolean getDebugUnfocus()
public void write(JmeExporter ex) throws java.io.IOException
Filter
public void read(JmeImporter im) throws java.io.IOException
Filter