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 SummaryNested classes/interfaces inherited from class com.jme3.post.FilterFilter.Pass
- 
Field SummaryFields inherited from class com.jme3.post.FilterdefaultPass, enabled, material, postRenderPasses, processor
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidoverride this method if you have some cleanup to dofloatReturn the depth sensitivity
 for more details seesetDepthSensitivity(float depthSensitivity)floatreturns the depth threshold
 for more details seesetDepthThreshold(float depthThreshold)returns the edge colorfloatreturns the edge intensity
 for more details seesetEdgeIntensity(float edgeIntensity)floatreturns the width of the edgesprotected MaterialMust return the material used for this filter.floatreturns the normals sensitivity
 form more details seesetNormalSensitivity(float normalSensitivity)floatreturns the normal threshold
 for more details seesetNormalThreshold(float normalThreshold)protected voidinitFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) Initialization of filter subclasses.protected booleanOverride this method and return true if your Filter needs the depth textureprotected voidpostQueue(RenderQueue queue) Override this method if you want to make a pre pass, before the actual rendering of the framevoidread(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);voidsetDepthSensitivity(float depthSensitivity) sets the depth sensitivity
 defines how much depth will influence edges, default is 10voidsetDepthThreshold(float depthThreshold) sets the depth threshold
 Defines at what threshold of difference of depth an edge is outlined default is 0.1fvoidsetEdgeColor(ColorRGBA edgeColor) Sets the edge color, default is blackvoidsetEdgeIntensity(float edgeIntensity) sets the edge intensity
 Defines how visible the outlined edges will bevoidsetEdgeWidth(float edgeWidth) sets the width of the edge in pixels default is 1voidsetNormalSensitivity(float normalSensitivity) Sets the normals sensitivity.voidsetNormalThreshold(float normalThreshold) sets the normal threshold default is 0.5voidwrite(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.Filtercleanup, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, postFrame, preFrame, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
- 
Constructor Details- 
CartoonEdgeFilterpublic CartoonEdgeFilter()Creates a CartoonEdgeFilter
 
- 
- 
Method Details- 
isRequiresDepthTextureprotected boolean isRequiresDepthTexture()Description copied from class:FilterOverride this method and return true if your Filter needs the depth texture- Overrides:
- isRequiresDepthTexturein class- Filter
- Returns:
- true if your Filter need the depth texture
 
- 
postQueueDescription copied from class:FilterOverride this method if you want to make a pre pass, before the actual rendering of the frame
- 
getMaterialDescription copied from class:FilterMust return the material used for this filter. this method is called every frame.- Specified by:
- getMaterialin class- Filter
- Returns:
- the material used for this filter.
 
- 
initFilterprotected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) Description copied from class:FilterInitialization 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:
- initFilterin 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
 
- 
cleanUpFilterDescription copied from class:Filteroverride this method if you have some cleanup to do- Overrides:
- cleanUpFilterin class- Filter
- Parameters:
- r- the renderer
 
- 
getDepthSensitivitypublic float getDepthSensitivity()Return the depth sensitivity
 for more details seesetDepthSensitivity(float depthSensitivity)- Returns:
- the depth sensitivity
 
- 
setDepthSensitivitypublic 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)
 
- 
getDepthThresholdpublic float getDepthThreshold()returns the depth threshold
 for more details seesetDepthThreshold(float depthThreshold)- Returns:
- the threshold
 
- 
setDepthThresholdpublic 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)
 
- 
getEdgeIntensitypublic float getEdgeIntensity()returns the edge intensity
 for more details seesetEdgeIntensity(float edgeIntensity)- Returns:
- the intensity
 
- 
setEdgeIntensitypublic void setEdgeIntensity(float edgeIntensity) sets the edge intensity
 Defines how visible the outlined edges will be- Parameters:
- edgeIntensity- the desired intensity (default=1)
 
- 
getEdgeWidthpublic float getEdgeWidth()returns the width of the edges- Returns:
- the width
 
- 
setEdgeWidthpublic void setEdgeWidth(float edgeWidth) sets the width of the edge in pixels default is 1- Parameters:
- edgeWidth- the desired width (in pixels, default=1)
 
- 
getNormalSensitivitypublic float getNormalSensitivity()returns the normals sensitivity
 form more details seesetNormalSensitivity(float normalSensitivity)- Returns:
- the sensitivity
 
- 
setNormalSensitivitypublic void setNormalSensitivity(float normalSensitivity) Sets the normals sensitivity. Default is 1.- Parameters:
- normalSensitivity- the desired sensitivity (default=1)
 
- 
getNormalThresholdpublic float getNormalThreshold()returns the normal threshold
 for more details seesetNormalThreshold(float normalThreshold)- Returns:
- the threshold
 
- 
setNormalThresholdpublic void setNormalThreshold(float normalThreshold) sets the normal threshold default is 0.5- Parameters:
- normalThreshold- the desired threshold (default=0.5)
 
- 
getEdgeColorreturns the edge color- Returns:
- the pre-existing instance
 
- 
setEdgeColorSets the edge color, default is black- Parameters:
- edgeColor- the desired color (alias created, default=(0,0,0,1))
 
- 
writeDescription copied from class:FilterOverride 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:
- writein interface- Savable
- Overrides:
- writein class- Filter
- Parameters:
- ex- the exporter (not null)
- Throws:
- IOException- from the exporter
 
- 
readDescription copied from class:FilterOverride 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:
- readin interface- Savable
- Overrides:
- readin class- Filter
- Throws:
- IOException
 
 
-