Class CartoonEdgeFilter

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

public class CartoonEdgeFilter extends com.jme3.post.Filter
Applies a cartoon-style edge detection filter to all objects in the scene.
Author:
Kirill Vainer
  • Constructor Details

    • CartoonEdgeFilter

      public CartoonEdgeFilter()
      Creates a CartoonEdgeFilter
  • Method Details

    • isRequiresDepthTexture

      protected boolean isRequiresDepthTexture()
      Overrides:
      isRequiresDepthTexture in class com.jme3.post.Filter
    • postQueue

      protected void postQueue(com.jme3.renderer.queue.RenderQueue queue)
      Overrides:
      postQueue in class com.jme3.post.Filter
    • getMaterial

      protected com.jme3.material.Material getMaterial()
      Specified by:
      getMaterial in class com.jme3.post.Filter
    • initFilter

      protected void initFilter(com.jme3.asset.AssetManager manager, com.jme3.renderer.RenderManager renderManager, com.jme3.renderer.ViewPort vp, int w, int h)
      Specified by:
      initFilter in class com.jme3.post.Filter
    • cleanUpFilter

      protected void cleanUpFilter(com.jme3.renderer.Renderer r)
      Overrides:
      cleanUpFilter in class com.jme3.post.Filter
    • getDepthSensitivity

      public float getDepthSensitivity()
      Return the depth sensitivity
      for more details see setDepthSensitivity(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 see setDepthThreshold(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 see setEdgeIntensity(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 see setNormalSensitivity(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 see setNormalThreshold(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

      public com.jme3.math.ColorRGBA getEdgeColor()
      returns the edge color
      Returns:
      the pre-existing instance
    • setEdgeColor

      public void setEdgeColor(com.jme3.math.ColorRGBA edgeColor)
      Sets the edge color, default is black
      Parameters:
      edgeColor - the desired color (alias created, default=(0,0,0,1))
    • write

      public void write(com.jme3.export.JmeExporter ex) throws IOException
      Specified by:
      write in interface com.jme3.export.Savable
      Overrides:
      write in class com.jme3.post.Filter
      Throws:
      IOException
    • read

      public void read(com.jme3.export.JmeImporter im) throws IOException
      Specified by:
      read in interface com.jme3.export.Savable
      Overrides:
      read in class com.jme3.post.Filter
      Throws:
      IOException