Package com.jme3.shadow
Class AbstractShadowFilterVR<T extends AbstractShadowRendererVR>
java.lang.Object
com.jme3.post.Filter
com.jme3.shadow.AbstractShadowFilterVR<T>
- Type Parameters:
- T- the type of the underlying renderer (subclass of- AbstractShadowRendererVR).
- All Implemented Interfaces:
- Savable
- Direct Known Subclasses:
- DirectionalLightShadowFilterVR
Generic abstract filter that holds common implementations for the different
 shadow filters.
- 
Nested Class SummaryNested classes/interfaces inherited from class com.jme3.post.FilterFilter.Pass
- 
Field SummaryFieldsFields inherited from class com.jme3.post.FilterdefaultPass, enabled, material, postRenderPasses, processor
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractShadowFilterVR(AssetManager manager, int shadowMapSize, T shadowRenderer) Abstract class constructorprotectedAbstractShadowFilterVR(AssetManager manager, int shadowMapSize, T shadowRenderer, String useMatDef) 
- 
Method SummaryModifier and TypeMethodDescriptionGet the edge filtering mode.intreturns the edges thicknessprotected MaterialMust return the material used for this filter.Get the pre-shadows pass render state.Get the shadow compare mode.floatreturns the shadow intensityGet thematerialused by this filter.floatHow far the shadows are rendered in the viewfloatget the length over which the shadow will fade out when using a shadowZextendprotected voidinitFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h) Initialization of filter subclasses.booleanDeprecated.does nothing and is kept only for backward compatibility.booleanIs this filter renders back faces shadows.protected booleanOverride this method and return true if your Filter needs the depth textureprotected voidpostFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) Override this method if you want to make a pass just after the frame has been rendered and just before the filter renderingprotected voidpostQueue(RenderQueue queue) Override this method if you want to make a pre pass, before the actual rendering of the frameprotected voidpreFrame(float tpf) Override this method if you want to modify parameters according to tpf before the rendering of the frame.voidread(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);final voidsetEdgeFilteringMode(EdgeFilteringMode filterMode) Sets the filtering mode for shadow edges seeEdgeFilteringModefor more infovoidsetEdgesThickness(int edgesThickness) Sets the shadow edge thickness.voidsetRenderBackFacesShadows(Boolean renderBackFacesShadows) WARNING this parameter is defaulted totruefor the shadow filter.final voidsetShadowCompareMode(CompareMode compareMode) Sets the shadow compare mode (seeCompareModefor more info).final voidsetShadowIntensity(float shadowIntensity) 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.7voidsetShadowZExtend(float zFar) 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.voidsetShadowZFadeLength(float length) Define the length over which the shadow will fade out when using a shadowZextendvoidwrite(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, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
- 
Field Details- 
shadowRenderer
- 
viewPort
 
- 
- 
Constructor Details- 
AbstractShadowFilterVRAbstract class constructor- Parameters:
- manager- the application asset manager
- shadowMapSize- the size of the rendered shadowmaps (512,1024,2048, etc...)
- shadowRenderer- the shadowRenderer to use for this Filter
 
- 
AbstractShadowFilterVRprotected AbstractShadowFilterVR(AssetManager manager, int shadowMapSize, T shadowRenderer, String useMatDef) 
 
- 
- 
Method Details- 
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.
 
- 
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
 
- 
getShadowMaterialGet thematerialused by this filter.- Returns:
- the materialused by this filter.
 
- 
preFrameprotected void preFrame(float tpf) Description copied from class:FilterOverride 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
- 
postQueueDescription copied from class:FilterOverride this method if you want to make a pre pass, before the actual rendering of the frame
- 
postFrameprotected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer) Description copied from class:FilterOverride this method if you want to make a pass just after the frame has been rendered and just before the filter rendering
- 
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
 
- 
getShadowZExtendpublic float getShadowZExtend()How far the shadows are rendered in the view- Returns:
- shadowZExtend
- See Also:
 
- 
setShadowZExtendpublic void setShadowZExtend(float zFar) 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
 
- 
setShadowZFadeLengthpublic void setShadowZFadeLength(float length) Define the length over which the shadow will fade out when using a shadowZextend- Parameters:
- length- the fade length in world units
 
- 
getShadowZFadeLengthpublic float getShadowZFadeLength()get the length over which the shadow will fade out when using a shadowZextend- Returns:
- the fade length in world units
 
- 
getShadowIntensitypublic float getShadowIntensity()returns the shadow intensity- Returns:
- shadowIntensity
- See Also:
 
- 
setShadowIntensitypublic final void setShadowIntensity(float shadowIntensity) 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
 
- 
getEdgesThicknesspublic int getEdgesThickness()returns the edges thickness- Returns:
- edgesThickness
- See Also:
 
- 
setEdgesThicknesspublic void setEdgesThickness(int edgesThickness) Sets the shadow edge thickness. Default is 1. Setting it to lower values can help to reduce the jagged effect of the shadow edges.- Parameters:
- edgesThickness- the edge thickness.
 
- 
isFlushQueuesDeprecated.does nothing and is kept only for backward compatibility.isFlushQueues does nothing and is kept only for backward compatibility.- Returns:
- false
 
- 
setShadowCompareModeSets the shadow compare mode (seeCompareModefor more info).- Parameters:
- compareMode- the compare mode.
 
- 
getShadowCompareModeGet the shadow compare mode.- Returns:
- the shadow compare mode.
- See Also:
 
- 
setEdgeFilteringModeSets the filtering mode for shadow edges seeEdgeFilteringModefor more info- Parameters:
- filterMode- the filtering mode for shadow edges.
 
- 
setRenderBackFacesShadowsWARNING this parameter is defaulted totruefor the shadow filter. Setting it totrue, may produce edges artifacts on shadows.
 
 Set totrueif you want back faces shadows on geometries. Note that back faces shadows will be blended over dark lighten areas and may produce overly dark lighting.
 
 Setting this parameter will override this parameter for ALL materials in the scene. This also will automatically adjust the face cull mode and the PolyOffset of the pre shadow pass. You can modify them by usinggetPreShadowForcedRenderState().
 
 If you want to set it differently for each material in the scene you have to use the ShadowRenderer instead of the shadow filter.- Parameters:
- renderBackFacesShadows-- trueif back faces shadows on geometries have to be rendered and- falseotherwise.
 
- 
isRenderBackFacesShadowspublic boolean isRenderBackFacesShadows()Is this filter renders back faces shadows.- Returns:
- trueif this filter renders back faces shadows and- falseotherwise.
 
- 
getPreShadowForcedRenderStateGet the pre-shadows pass render state. use it to adjust the RenderState parameters of the pre shadow pass. Note that this will be overridden if the preShadow technique in the material has a ForcedRenderState- Returns:
- the pre shadow render state.
 
- 
getEdgeFilteringModeGet the edge filtering mode.- Returns:
- the edge filtering mode.
 
- 
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
 
 
-