Class PssmShadowRenderer

java.lang.Object
com.jme3.shadow.PssmShadowRenderer
All Implemented Interfaces:
SceneProcessor

@Deprecated public class PssmShadowRenderer extends Object implements SceneProcessor
PssmShadow renderer use Parallel Split Shadow Mapping technique (pssm)
It splits the view frustum in several parts and compute a shadow map for each one.
splits are distributed so that the closer they are from the camera, the smaller they are to maximize the resolution used of the shadow map.
This results in a better quality shadow than standard shadow mapping.
for more information on this read http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
  • Field Details

    • nbSplits

      protected int nbSplits
      Deprecated.
    • shadowMapSize

      protected float shadowMapSize
      Deprecated.
    • lambda

      protected float lambda
      Deprecated.
    • shadowIntensity

      protected float shadowIntensity
      Deprecated.
    • zFarOverride

      protected float zFarOverride
      Deprecated.
    • renderManager

      protected RenderManager renderManager
      Deprecated.
    • viewPort

      protected ViewPort viewPort
      Deprecated.
    • shadowFB

      protected FrameBuffer[] shadowFB
      Deprecated.
    • shadowMaps

      protected Texture2D[] shadowMaps
      Deprecated.
    • dummyTex

      protected Texture2D dummyTex
      Deprecated.
    • shadowCam

      protected Camera shadowCam
      Deprecated.
    • preshadowMat

      protected Material preshadowMat
      Deprecated.
    • postshadowMat

      protected Material postshadowMat
      Deprecated.
    • splitOccluders

      protected GeometryList splitOccluders
      Deprecated.
    • lightViewProjectionsMatrices

      protected Matrix4f[] lightViewProjectionsMatrices
      Deprecated.
    • splits

      protected ColorRGBA splits
      Deprecated.
    • splitsArray

      protected float[] splitsArray
      Deprecated.
    • noOccluders

      protected boolean noOccluders
      Deprecated.
    • direction

      protected Vector3f direction
      Deprecated.
    • assetManager

      protected AssetManager assetManager
      Deprecated.
    • debug

      protected boolean debug
      Deprecated.
    • edgesThickness

      protected float edgesThickness
      Deprecated.
    • filterMode

      protected PssmShadowRenderer.FilterMode filterMode
      Deprecated.
    • compareMode

      protected PssmShadowRenderer.CompareMode compareMode
      Deprecated.
    • dispPic

      protected Picture[] dispPic
      Deprecated.
    • points

      protected Vector3f[] points
      Deprecated.
    • flushQueues

      protected boolean flushQueues
      Deprecated.
    • needsfallBackMaterial

      protected boolean needsfallBackMaterial
      Deprecated.
    • postTechniqueName

      protected String postTechniqueName
      Deprecated.
    • applyHWShadows

      protected boolean applyHWShadows
      Deprecated.
    • applyFilterMode

      protected boolean applyFilterMode
      Deprecated.
    • applyPCFEdge

      protected boolean applyPCFEdge
      Deprecated.
    • applyShadowIntensity

      protected boolean applyShadowIntensity
      Deprecated.
    • matCache

      protected List<Material> matCache
      Deprecated.
    • fadeInfo

      protected Vector2f fadeInfo
      Deprecated.
    • fadeLength

      protected float fadeLength
      Deprecated.
    • applyFadeInfo

      protected boolean applyFadeInfo
      Deprecated.
    • lightReceivers

      protected GeometryList lightReceivers
      Deprecated.
  • Constructor Details

    • PssmShadowRenderer

      public PssmShadowRenderer(AssetManager manager, int size, int nbSplits)
      Deprecated.
      Create a PSSM Shadow Renderer More info on the technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
      Parameters:
      manager - the application asset manager
      size - the size of the rendered shadowmaps (512,1024,2048, etc...)
      nbSplits - the number of shadow maps rendered (the more shadow maps the more quality, the less fps)
    • PssmShadowRenderer

      protected PssmShadowRenderer(AssetManager manager, int size, int nbSplits, Material postShadowMat)
      Deprecated.
      Create a PSSM Shadow Renderer More info on the technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
      Parameters:
      manager - the application asset manager
      size - the size of the rendered shadowmaps (512,1024,2048, etc...)
      nbSplits - the number of shadow maps rendered (the more shadow maps the more quality, the less fps).
      postShadowMat - the material used for post shadows if you need to override it
  • Method Details

    • 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)
    • 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)
    • initialize

      public void initialize(RenderManager rm, ViewPort vp)
      Deprecated.
      Description copied from interface: SceneProcessor
      Called in the render thread to initialize the scene processor.
      Specified by:
      initialize in interface SceneProcessor
      Parameters:
      rm - The render manager to which the SP was added to
      vp - The viewport to which the SP is assigned
    • isInitialized

      public boolean isInitialized()
      Deprecated.
      Specified by:
      isInitialized in interface SceneProcessor
      Returns:
      True if initialize() has been called on this SceneProcessor, false if otherwise.
    • getDirection

      public Vector3f getDirection()
      Deprecated.
      returns the light direction used by the processor
      Returns:
      the pre-existing 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)
    • postQueue

      public void postQueue(RenderQueue rq)
      Deprecated.
      Description copied from interface: SceneProcessor
      Called after the scene graph has been queued, but before it is flushed.
      Specified by:
      postQueue in interface SceneProcessor
      Parameters:
      rq - The render queue
    • displayFrustum

      public void displayFrustum()
      Deprecated.
    • displayShadowMap

      protected void displayShadowMap(Renderer r)
      Deprecated.
    • displayDebug

      public void displayDebug()
      Deprecated.
      For debugging purpose Allow to "snapshot" the current frustum to the scene
    • postFrame

      public void postFrame(FrameBuffer out)
      Deprecated.
      Description copied from interface: SceneProcessor
      Called after a frame has been rendered and the queue flushed.
      Specified by:
      postFrame in interface SceneProcessor
      Parameters:
      out - The FB to which the scene was rendered.
    • setPostShadowParams

      protected void setPostShadowParams()
      Deprecated.
    • preFrame

      public void preFrame(float tpf)
      Deprecated.
      Description copied from interface: SceneProcessor
      Called before a frame
      Specified by:
      preFrame in interface SceneProcessor
      Parameters:
      tpf - Time per frame
    • cleanup

      public void cleanup()
      Deprecated.
      Description copied from interface: SceneProcessor
      Called when the SP is removed from the RM.
      Specified by:
      cleanup in interface SceneProcessor
    • reshape

      public void reshape(ViewPort vp, int w, int h)
      Deprecated.
      Description copied from interface: SceneProcessor
      Called when the resolution of the viewport has been changed.
      Specified by:
      reshape in interface SceneProcessor
      Parameters:
      vp - the affected ViewPort
      w - the new width (in pixels)
      h - the new height (in pixels)
    • getLambda

      public float getLambda()
      Deprecated.
      returns the lambda parameter see #setLambda(float lambda)
      Returns:
      lambda
    • 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 repartition, resulting in consistent shadow quality over the extend, but near shadows could look very jagged. A high value gives a more logarithmic repartition, 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
    • setShadowZFadeLength

      public void setShadowZFadeLength(float length)
      Deprecated.
      Define the length over which the shadow will fade out when using a shadowZextend This is useful to make dynamic shadows fade into baked shadows in the distance.
      Parameters:
      length - the fade length in world units
    • setProfiler

      public void setProfiler(AppProfiler profiler)
      Deprecated.
      Description copied from interface: SceneProcessor
      Sets a profiler Instance for this processor.
      Specified by:
      setProfiler in interface SceneProcessor
      Parameters:
      profiler - the profiler instance.
    • 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