Package com.jme3.post.filters
Class CartoonEdgeFilter
java.lang.Object
com.jme3.post.Filter
com.jme3.post.filters.CartoonEdgeFilter
- All Implemented Interfaces:
Savable
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
override this method if you have some cleanup to dofloat
Return the depth sensitivity
for more details seesetDepthSensitivity(float depthSensitivity)
float
returns the depth threshold
for more details seesetDepthThreshold(float depthThreshold)
returns the edge colorfloat
returns the edge intensity
for more details seesetEdgeIntensity(float edgeIntensity)
float
returns the width of the edgesprotected Material
Must return the material used for this filter.float
returns the normals sensitivity
form more details seesetNormalSensitivity(float normalSensitivity)
float
returns the normal threshold
for more details seesetNormalThreshold(float normalThreshold)
protected void
initFilter
(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) Initialization of filter subclasses.protected boolean
Override this method and return true if your Filter needs the depth textureprotected void
postQueue
(RenderQueue queue) Override this method if you want to make a pre pass, before the actual rendering of the framevoid
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
setDepthSensitivity
(float depthSensitivity) sets the depth sensitivity
defines how much depth will influence edges, default is 10void
setDepthThreshold
(float depthThreshold) sets the depth threshold
Defines at what threshold of difference of depth an edge is outlined default is 0.1fvoid
setEdgeColor
(ColorRGBA edgeColor) Sets the edge color, default is blackvoid
setEdgeIntensity
(float edgeIntensity) sets the edge intensity
Defines how visible the outlined edges will bevoid
setEdgeWidth
(float edgeWidth) sets the width of the edge in pixels default is 1void
setNormalSensitivity
(float normalSensitivity) Sets the normals sensitivity.void
setNormalThreshold
(float normalThreshold) sets the normal threshold default is 0.5void
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, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, postFrame, preFrame, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
-
Constructor Details
-
CartoonEdgeFilter
public CartoonEdgeFilter()Creates a CartoonEdgeFilter
-
-
Method Details
-
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 classFilter
- Returns:
- true if your Filter need the depth texture
-
postQueue
Description copied from class:Filter
Override this method if you want to make a pre pass, before the actual rendering of the frame -
getMaterial
Description copied from class:Filter
Must return the material used for this filter. this method is called every frame.- Specified by:
getMaterial
in classFilter
- 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 filter subclasses. 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 classFilter
- Parameters:
manager
- the assetManagerrenderManager
- the renderManagervp
- the viewPort where this filter is renderedw
- the width of the filterh
- the height of the filter
-
cleanUpFilter
Description copied from class:Filter
override this method if you have some cleanup to do- Overrides:
cleanUpFilter
in classFilter
- Parameters:
r
- the renderer
-
getDepthSensitivity
public float getDepthSensitivity()Return the depth sensitivity
for more details seesetDepthSensitivity(float depthSensitivity)
- Returns:
- the depth sensitivity
-
setDepthSensitivity
public void setDepthSensitivity(float depthSensitivity) sets the depth sensitivity
defines how much depth will influence edges, default is 10- Parameters:
depthSensitivity
- the desired sensitivity (default=10)
-
getDepthThreshold
public float getDepthThreshold()returns the depth threshold
for more details seesetDepthThreshold(float depthThreshold)
- Returns:
- the threshold
-
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
- the desired threshold (default=0.1)
-
getEdgeIntensity
public float getEdgeIntensity()returns the edge intensity
for more details seesetEdgeIntensity(float edgeIntensity)
- Returns:
- the intensity
-
setEdgeIntensity
public void setEdgeIntensity(float edgeIntensity) sets the edge intensity
Defines how visible the outlined edges will be- Parameters:
edgeIntensity
- the desired intensity (default=1)
-
getEdgeWidth
public float getEdgeWidth()returns the width of the edges- Returns:
- the width
-
setEdgeWidth
public void setEdgeWidth(float edgeWidth) sets the width of the edge in pixels default is 1- Parameters:
edgeWidth
- the desired width (in pixels, default=1)
-
getNormalSensitivity
public float getNormalSensitivity()returns the normals sensitivity
form more details seesetNormalSensitivity(float normalSensitivity)
- Returns:
- the sensitivity
-
setNormalSensitivity
public void setNormalSensitivity(float normalSensitivity) Sets the normals sensitivity. Default is 1.- Parameters:
normalSensitivity
- the desired sensitivity (default=1)
-
getNormalThreshold
public float getNormalThreshold()returns the normal threshold
for more details seesetNormalThreshold(float normalThreshold)
- Returns:
- the threshold
-
setNormalThreshold
public void setNormalThreshold(float normalThreshold) sets the normal threshold default is 0.5- Parameters:
normalThreshold
- the desired threshold (default=0.5)
-
getEdgeColor
returns the edge color- Returns:
- the pre-existing instance
-
setEdgeColor
Sets the edge color, default is black- Parameters:
edgeColor
- the desired color (alias created, default=(0,0,0,1))
-
write
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 interfaceSavable
- Overrides:
write
in classFilter
- Parameters:
ex
- the exporter (not null)- Throws:
IOException
- from the exporter
-
read
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 interfaceSavable
- Overrides:
read
in classFilter
- Throws:
IOException
-