public class DepthOfFieldFilter
extends com.jme3.post.Filter
| 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 com.jme3.material.Material |
getMaterial() |
protected void |
initFilter(com.jme3.asset.AssetManager assets,
com.jme3.renderer.RenderManager renderManager,
com.jme3.renderer.ViewPort vp,
int w,
int h) |
protected boolean |
isRequiresDepthTexture() |
void |
read(com.jme3.export.JmeImporter 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(com.jme3.export.JmeExporter ex) |
cleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, postFrame, postQueue, preFrame, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBufferprotected boolean isRequiresDepthTexture()
isRequiresDepthTexture in class com.jme3.post.Filterprotected com.jme3.material.Material getMaterial()
getMaterial in class com.jme3.post.Filterprotected void initFilter(com.jme3.asset.AssetManager assets,
com.jme3.renderer.RenderManager renderManager,
com.jme3.renderer.ViewPort vp,
int w,
int h)
initFilter in class com.jme3.post.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(com.jme3.export.JmeExporter ex)
throws java.io.IOException
write in interface com.jme3.export.Savablewrite in class com.jme3.post.Filterjava.io.IOExceptionpublic void read(com.jme3.export.JmeImporter im)
throws java.io.IOException
read in interface com.jme3.export.Savableread in class com.jme3.post.Filterjava.io.IOException