Class PssmShadowFilter

java.lang.Object
com.jme3.post.Filter
com.jme3.shadow.PssmShadowFilter
All Implemented Interfaces:
Savable

@Deprecated public class PssmShadowFilter extends Filter
This Filter does basically the same as a PssmShadowRenderer except it renders the post shadow pass as a fullscreen quad pass instead of a geometry pass. It's mostly faster than PssmShadowRenderer as long as you have more than about ten shadow receiving objects. The expense is the drawback that the shadow Receive mode set on spatial is ignored. So basically all and only objects that render depth in the scene receive shadows. See this post for more details http://jmonkeyengine.org/groups/general-2/forum/topic/silly-question-about-shadow-rendering/#post-191599 API is basically the same as the PssmShadowRenderer;
  • Constructor Details

    • PssmShadowFilter

      protected PssmShadowFilter()
      Deprecated.
      Used for serialization. Use PssmShadowFilter#PssmShadowFilter(AssetManager assetManager, int size, int nbSplits) instead.
    • PssmShadowFilter

      public PssmShadowFilter(AssetManager manager, int size, int nbSplits)
      Deprecated.
      Creates a PSSM shadow filter. More info on the technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
      Parameters:
      manager - the application's asset manager
      size - the size of the rendered shadowmaps (512, 1024, 2048, etcetera)
      nbSplits - the number of shadow maps rendered (More shadow maps mean better quality, fewer frames per second.)
  • Method Details

    • getMaterial

      protected Material getMaterial()
      Deprecated.
      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.
    • isRequiresDepthTexture

      protected boolean isRequiresDepthTexture()
      Deprecated.
      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
    • getShadowMaterial

      public Material getShadowMaterial()
      Deprecated.
    • preFrame

      protected void preFrame(float tpf)
      Deprecated.
      Description copied from class: Filter
      Override this method if you want to modify parameters according to tpf before the rendering of the frame. This is useful for animated filters Also it can be the place to render pre passes
      Overrides:
      preFrame in class Filter
      Parameters:
      tpf - the time used to render the previous frame
    • postQueue

      protected void postQueue(RenderQueue queue)
      Deprecated.
      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
      Parameters:
      queue - the RenderQueue
    • postFrame

      protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer)
      Deprecated.
      Description copied from class: Filter
      Override this method if you want to make a pass just after the frame has been rendered and just before the filter rendering
      Overrides:
      postFrame in class Filter
      Parameters:
      renderManager - for rendering
      viewPort - for rendering
      prevFilterBuffer - the FrameBuffer of the previous filter
      sceneBuffer - the FrameBuffer of the scene
    • initFilter

      protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h)
      Deprecated.
      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 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
    • getDirection

      public Vector3f getDirection()
      Deprecated.
      returns the light direction used by the processor
      Returns:
      a direction vector
    • setDirection

      public void setDirection(Vector3f direction)
      Deprecated.
      Sets the light direction to use to compute shadows
      Parameters:
      direction - a direction vector (not null, unaffected)
    • getLambda

      public float getLambda()
      Deprecated.
      returns the lambda parameter
      Returns:
      lambda
      See Also:
    • setLambda

      public void setLambda(float lambda)
      Deprecated.
      Adjusts the partition of the shadow extend into shadow maps. Lambda is usually between 0 and 1. A low value gives a more linear partition, resulting in consistent shadow quality over the extend, but near shadows could look very jagged. A high value gives a more logarithmic partition, resulting in high quality for near shadows, but quality decreases rapidly with distance. The default value is 0.65 (the theoretical optimum).
      Parameters:
      lambda - the lambda value.
    • getShadowZExtend

      public float getShadowZExtend()
      Deprecated.
      How far the shadows are rendered in the view
      Returns:
      shadowZExtend
      See Also:
    • setShadowZExtend

      public void setShadowZExtend(float zFar)
      Deprecated.
      Set the distance from the eye where the shadows will be rendered default value is dynamically computed to the shadow casters/receivers union bound zFar, capped to view frustum far value.
      Parameters:
      zFar - the zFar values that override the computed one
    • getShadowIntensity

      public float getShadowIntensity()
      Deprecated.
      returns the shadow intensity
      Returns:
      shadowIntensity
      See Also:
    • setShadowIntensity

      public final void setShadowIntensity(float shadowIntensity)
      Deprecated.
      Set the shadowIntensity, the value should be between 0 and 1, a 0 value gives a bright and invisible shadow, a 1 value gives a pitch black shadow, default is 0.7
      Parameters:
      shadowIntensity - the darkness of the shadow
    • getEdgesThickness

      public int getEdgesThickness()
      Deprecated.
      returns the edges thickness
      Returns:
      edgesThickness
      See Also:
    • setEdgesThickness

      public void setEdgesThickness(int edgesThickness)
      Deprecated.
      Sets the shadow edges thickness. Default is 1. Setting it to lower values can help to reduce the jagged effect of the shadow edges.
      Parameters:
      edgesThickness - the desired thickness (in tenths of a pixel, default=10)
    • isFlushQueues

      public boolean isFlushQueues()
      Deprecated.
      returns true if the PssmRenderer flushed the shadow queues
      Returns:
      flushQueues
    • setFlushQueues

      public void setFlushQueues(boolean flushQueues)
      Deprecated.
      Set this to false if you want to use several PssmRenderers to have multiple shadows cast by multiple light sources. Make sure the last PssmRenderer in the stack DOES flush the queues, but not the others
      Parameters:
      flushQueues - true to flush the queues, false to avoid flushing them
    • setCompareMode

      public final void setCompareMode(PssmShadowRenderer.CompareMode compareMode)
      Deprecated.
      sets the shadow compare mode see PssmShadowRenderer.CompareMode for more info
      Parameters:
      compareMode - the desired mode (not null)
    • setFilterMode

      public final void setFilterMode(PssmShadowRenderer.FilterMode filterMode)
      Deprecated.
      Sets the filtering mode for shadow edges see PssmShadowRenderer.FilterMode for more info
      Parameters:
      filterMode - the desired mode (not null)
    • setShadowZFadeLength

      public void setShadowZFadeLength(float length)
      Deprecated.
      Define the length over which the shadow will fade out when using a shadowZextend
      Parameters:
      length - the fade length in world units
    • getShadowZFadeLength

      public float getShadowZFadeLength()
      Deprecated.
      get the length over which the shadow will fade out when using a shadowZextend
      Returns:
      the fade length in world units
    • write

      public void write(JmeExporter ex) throws IOException
      Deprecated.
      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 interface Savable
      Overrides:
      write in class Filter
      Parameters:
      ex - the exporter (not null)
      Throws:
      IOException - from the exporter
    • read

      public void read(JmeImporter im) throws IOException
      Deprecated.
      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 interface Savable
      Overrides:
      read in class Filter
      Throws:
      IOException