T
- the type of the underlying renderer (subclass of AbstractShadowRendererVR
).public abstract class AbstractShadowFilterVR<T extends AbstractShadowRendererVR> extends Filter
Filter.Pass
Modifier and Type | Field and Description |
---|---|
protected T |
shadowRenderer |
protected ViewPort |
viewPort |
defaultPass, enabled, material, postRenderPasses, processor
Modifier | Constructor and Description |
---|---|
protected |
AbstractShadowFilterVR(AssetManager manager,
int shadowMapSize,
T shadowRenderer)
Abstract class constructor
|
protected |
AbstractShadowFilterVR(AssetManager manager,
int shadowMapSize,
T shadowRenderer,
java.lang.String useMatDef) |
Modifier and Type | Method and Description |
---|---|
EdgeFilteringMode |
getEdgeFilteringMode()
Get the edge filtering mode.
|
int |
getEdgesThickness()
returns the edges thickness
|
protected Material |
getMaterial()
Must return the material used for this filter.
|
RenderState |
getPreShadowForcedRenderState()
Get the pre-shadows pass render state.
|
CompareMode |
getShadowCompareMode()
Get the shadow compare mode.
|
float |
getShadowIntensity()
returns the shadow intensity
|
Material |
getShadowMaterial()
Get the
material used by this filter. |
float |
getShadowZExtend()
How far the shadows are rendered in the view
|
float |
getShadowZFadeLength()
get the length over which the shadow will fade out when using a
shadowZextend
|
protected void |
initFilter(AssetManager manager,
RenderManager renderManager,
ViewPort vp,
int w,
int h)
Initialization of filter subclasses.
|
boolean |
isFlushQueues()
Deprecated.
does nothing and is kept only for backward compatibility.
|
boolean |
isRenderBackFacesShadows()
Is this filter renders back faces shadows.
|
protected boolean |
isRequiresDepthTexture()
Override this method and return true if your Filter needs the depth texture
|
protected void |
postFrame(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 rendering
|
protected void |
postQueue(RenderQueue queue)
Override this method if you want to make a pre pass, before the actual rendering of the frame
|
protected void |
preFrame(float tpf)
Override this method if you want to modify parameters according to tpf before the rendering of the frame.
|
void |
read(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);
|
void |
setEdgeFilteringMode(EdgeFilteringMode filterMode)
Sets the filtering mode for shadow edges see
EdgeFilteringMode for more info |
void |
setEdgesThickness(int edgesThickness)
Sets the shadow edge thickness.
|
void |
setRenderBackFacesShadows(java.lang.Boolean renderBackFacesShadows)
WARNING this parameter is defaulted to
true for the shadow filter. |
void |
setShadowCompareMode(CompareMode compareMode)
Sets the shadow compare mode (see
CompareMode for more info). |
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
|
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.
|
void |
setShadowZFadeLength(float length)
Define the length over which the shadow will fade out when using a
shadowZextend
|
void |
write(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);
|
cleanup, cleanUpFilter, getDefaultPassDepthFormat, getDefaultPassTextureFormat, getName, getPostRenderPasses, getRenderedTexture, getRenderFrameBuffer, init, isEnabled, isRequiresBilinear, isRequiresSceneTexture, postFilter, setDepthTexture, setEnabled, setName, setProcessor, setRenderedTexture, setRenderFrameBuffer
protected T extends AbstractShadowRendererVR shadowRenderer
protected ViewPort viewPort
protected AbstractShadowFilterVR(AssetManager manager, int shadowMapSize, T shadowRenderer)
manager
- the application asset managershadowMapSize
- the size of the rendered shadowmaps (512,1024,2048,
etc...)shadowRenderer
- the shadowRenderer to use for this Filterprotected AbstractShadowFilterVR(AssetManager manager, int shadowMapSize, T shadowRenderer, java.lang.String useMatDef)
protected Material getMaterial()
Filter
getMaterial
in class Filter
protected boolean isRequiresDepthTexture()
Filter
isRequiresDepthTexture
in class Filter
public Material getShadowMaterial()
material
used by this filter.material
used by this filter.protected void preFrame(float tpf)
Filter
protected void postQueue(RenderQueue queue)
Filter
protected void postFrame(RenderManager renderManager, ViewPort viewPort, FrameBuffer prevFilterBuffer, FrameBuffer sceneBuffer)
Filter
protected void initFilter(AssetManager manager, RenderManager renderManager, ViewPort vp, int w, int h)
Filter
initFilter
in class Filter
manager
- the assetManagerrenderManager
- the renderManagervp
- the viewPort where this filter is renderedw
- the width of the filterh
- the height of the filterpublic float getShadowZExtend()
setShadowZExtend(float zFar)
public void setShadowZExtend(float zFar)
zFar
- the zFar values that override the computed onepublic void setShadowZFadeLength(float length)
length
- the fade length in world unitspublic float getShadowZFadeLength()
public float getShadowIntensity()
setShadowIntensity(float shadowIntensity)
public final void setShadowIntensity(float shadowIntensity)
shadowIntensity
- the darkness of the shadowpublic int getEdgesThickness()
setEdgesThickness(int edgesThickness)
public void setEdgesThickness(int edgesThickness)
edgesThickness
- the edge thickness.@Deprecated public boolean isFlushQueues()
false
public final void setShadowCompareMode(CompareMode compareMode)
CompareMode
for more info).compareMode
- the compare mode.public CompareMode getShadowCompareMode()
CompareMode
public final void setEdgeFilteringMode(EdgeFilteringMode filterMode)
EdgeFilteringMode
for more infofilterMode
- the filtering mode for shadow edges.public void setRenderBackFacesShadows(java.lang.Boolean renderBackFacesShadows)
true
for the shadow filter. Setting it to true
, may produce edges artifacts on shadows.true
if 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.getPreShadowForcedRenderState()
.renderBackFacesShadows
- true
if back faces shadows on geometries have to be rendered and false
otherwise.public boolean isRenderBackFacesShadows()
true
if this filter renders back faces shadows and false
otherwise.public RenderState getPreShadowForcedRenderState()
public EdgeFilteringMode getEdgeFilteringMode()
public void write(JmeExporter ex) throws java.io.IOException
Filter
public void read(JmeImporter im) throws java.io.IOException
Filter