com.jme3.post.filters
Class CartoonEdgeFilter

java.lang.Object
  extended by com.jme3.post.Filter
      extended by com.jme3.post.filters.CartoonEdgeFilter
All Implemented Interfaces:
Savable

public class CartoonEdgeFilter
extends Filter

Applies a cartoon-style edge detection filter to all objects in the scene.


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
CartoonEdgeFilter()
          Creates a CartoonEdgeFilter
 
Method Summary
 float getDepthSensitivity()
          Return the depth sensitivity
for more details see setDepthSensitivity(float depthSensitivity)
 float getDepthThreshold()
          returns the depth threshold
for more details see setDepthThreshold(float depthThreshold)
 ColorRGBA getEdgeColor()
          returns the edge color
 float getEdgeIntensity()
          returns the edge intensity
for more details see setEdgeIntensity(float edgeIntensity)
 float getEdgeWidth()
          returns the width of the edges
protected  Material getMaterial()
          Must return the material used for this filter.
 float getNormalSensitivity()
          returns the normals sensitivity
form more details see setNormalSensitivity(float normalSensitivity)
 float getNormalThreshold()
          returns the normal threshold
for more details see setNormalThreshold(float normalThreshold)
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
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 setDepthSensitivity(float depthSensitivity)
          sets the depth sensitivity
defines how much depth will influence edges, default is 10
 void setDepthThreshold(float depthThreshold)
          sets the depth threshold
Defines at what threshold of difference of depth an edge is outlined default is 0.1f
 void setEdgeColor(ColorRGBA edgeColor)
          Sets the edge color, default is black
 void setEdgeIntensity(float edgeIntensity)
          sets the edge intensity
Defineshow visilble will be the outlined edges
 void setEdgeWidth(float edgeWidth)
          sets the witdh of the edge in pixels default is 1
 void setNormalSensitivity(float normalSensitivity)
          sets the normals sensitivity default is 1
 void setNormalThreshold(float normalThreshold)
          sets the normal threshold default is 0.5
 
Methods inherited from class com.jme3.post.Filter
cleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresSceneTexture, postFrame, preFrame, read, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CartoonEdgeFilter

public CartoonEdgeFilter()
Creates a CartoonEdgeFilter

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

getDepthSensitivity

public float getDepthSensitivity()
Return the depth sensitivity
for more details see setDepthSensitivity(float depthSensitivity)

Returns:

setDepthSensitivity

public void setDepthSensitivity(float depthSensitivity)
sets the depth sensitivity
defines how much depth will influence edges, default is 10

Parameters:
depthSensitivity -

getDepthThreshold

public float getDepthThreshold()
returns the depth threshold
for more details see setDepthThreshold(float depthThreshold)

Returns:

setDepthThreshold

public void setDepthThreshold(float depthThreshold)
sets the depth threshold
Defines at what threshold of difference of depth an edge is outlined default is 0.1f

Parameters:
depthThreshold -

getEdgeIntensity

public float getEdgeIntensity()
returns the edge intensity
for more details see setEdgeIntensity(float edgeIntensity)

Returns:

setEdgeIntensity

public void setEdgeIntensity(float edgeIntensity)
sets the edge intensity
Defineshow visilble will be the outlined edges

Parameters:
edgeIntensity -

getEdgeWidth

public float getEdgeWidth()
returns the width of the edges

Returns:

setEdgeWidth

public void setEdgeWidth(float edgeWidth)
sets the witdh of the edge in pixels default is 1

Parameters:
edgeWidth -

getNormalSensitivity

public float getNormalSensitivity()
returns the normals sensitivity
form more details see setNormalSensitivity(float normalSensitivity)

Returns:

setNormalSensitivity

public void setNormalSensitivity(float normalSensitivity)
sets the normals sensitivity default is 1

Parameters:
normalSensitivity -

getNormalThreshold

public float getNormalThreshold()
returns the normal threshold
for more details see setNormalThreshold(float normalThreshold)

Returns:

setNormalThreshold

public void setNormalThreshold(float normalThreshold)
sets the normal threshold default is 0.5

Parameters:
normalThreshold -

getEdgeColor

public ColorRGBA getEdgeColor()
returns the edge color

Returns:

setEdgeColor

public void setEdgeColor(ColorRGBA edgeColor)
Sets the edge color, default is black

Parameters:
edgeColor -