Package com.jme3.shadow
Class PssmShadowFilter
java.lang.Object
com.jme3.post.Filter
com.jme3.shadow.PssmShadowFilter
- All Implemented Interfaces:
Savable
Deprecated.
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;
-
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
ModifierConstructorDescriptionprotected
Deprecated.Used for serialization.PssmShadowFilter
(AssetManager manager, int size, int nbSplits) Deprecated.Creates a PSSM shadow filter. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.returns the light direction used by the processorint
Deprecated.returns the edges thicknessfloat
Deprecated.returns the lambda parameterprotected Material
Deprecated.Must return the material used for this filter.float
Deprecated.returns the shadow intensityDeprecated.float
Deprecated.How far the shadows are rendered in the viewfloat
Deprecated.get the length over which the shadow will fade out when using a shadowZextendprotected void
initFilter
(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) Deprecated.Initialization of filter subclasses.boolean
Deprecated.returns true if the PssmRenderer flushed the shadow queuesprotected boolean
Deprecated.Override this method and return true if your Filter needs the depth textureprotected void
postFrame
(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) Deprecated.Override this method if you want to make a pass just after the frame has been rendered and just before the filter renderingprotected void
postQueue
(RenderQueue queue) Deprecated.Override this method if you want to make a pre pass, before the actual rendering of the frameprotected void
preFrame
(float tpf) Deprecated.Override this method if you want to modify parameters according to tpf before the rendering of the frame.void
read
(JmeImporter im) Deprecated.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);final void
setCompareMode
(PssmShadowRenderer.CompareMode compareMode) Deprecated.sets the shadow compare mode seePssmShadowRenderer.CompareMode
for more infovoid
setDirection
(Vector3f direction) Deprecated.Sets the light direction to use to compute shadowsvoid
setEdgesThickness
(int edgesThickness) Deprecated.Sets the shadow edges thickness.final void
setFilterMode
(PssmShadowRenderer.FilterMode filterMode) Deprecated.Sets the filtering mode for shadow edges seePssmShadowRenderer.FilterMode
for more infovoid
setFlushQueues
(boolean flushQueues) Deprecated.Set this to false if you want to use several PssmRenderers to have multiple shadows cast by multiple light sources.void
setLambda
(float lambda) Deprecated.Adjusts the partition of the shadow extend into shadow maps.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.7void
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.void
setShadowZFadeLength
(float length) Deprecated.Define the length over which the shadow will fade out when using a shadowZextendvoid
write
(JmeExporter ex) Deprecated.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, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
-
Constructor Details
-
PssmShadowFilter
protected PssmShadowFilter()Deprecated.Used for serialization. Use PssmShadowFilter#PssmShadowFilter(AssetManager assetManager, int size, int nbSplits) instead. -
PssmShadowFilter
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 managersize
- 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
Deprecated.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.
-
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 classFilter
- Returns:
- true if your Filter need the depth texture
-
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 -
postQueue
Deprecated.Description copied from class:Filter
Override this method if you want to make a pre pass, before the actual rendering of the frame -
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 -
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 classFilter
- Parameters:
manager
- the assetManagerrenderManager
- the renderManagervp
- the viewPort where this filter is renderedw
- the width of the filterh
- the height of the filter
-
getDirection
Deprecated.returns the light direction used by the processor- Returns:
- a direction vector
-
setDirection
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
Deprecated.sets the shadow compare mode seePssmShadowRenderer.CompareMode
for more info- Parameters:
compareMode
- the desired mode (not null)
-
setFilterMode
Deprecated.Sets the filtering mode for shadow edges seePssmShadowRenderer.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
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 interfaceSavable
- Overrides:
write
in classFilter
- Parameters:
ex
- the exporter (not null)- Throws:
IOException
- from the exporter
-
read
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 interfaceSavable
- Overrides:
read
in classFilter
- Throws:
IOException
-
DirectionalLightShadowFilter