Package com.jme3.shadow
Class AbstractShadowRendererVR
java.lang.Object
com.jme3.shadow.AbstractShadowRendererVR
- All Implemented Interfaces:
Savable
,SceneProcessor
- Direct Known Subclasses:
DirectionalLightShadowRendererVR
@Deprecated
public abstract class AbstractShadowRendererVR
extends Object
implements SceneProcessor, Savable
Deprecated.
The jme3-vr module is deprecated and will be removed in a future version (as it only supports OpenVR).
For new Virtual Reality projects, use user libraries that provide OpenXR support.
See Virtual Reality JME wiki section
for more information.
Abstract shadow renderer that holds commons feature to have for a shadow
renderer.
-
Field Summary
Modifier and TypeFieldDescriptionprotected AssetManager
Deprecated.protected boolean
Deprecated.protected Picture[]
Deprecated.protected Texture2D
Deprecated.protected EdgeFilteringMode
Deprecated.protected float
Deprecated.protected Vector2f
Deprecated.protected float
Deprecated.protected RenderState
Deprecated.protected Camera
Deprecated.protected GeometryList
Deprecated.protected Matrix4f[]
Deprecated.Deprecated.list of materials for post shadow queue geometriesprotected int
Deprecated.protected boolean
Deprecated.true if the fallback material should be used, otherwise falseprotected Material
Deprecated.protected String
Deprecated.name of the post material techniqueprotected Material
Deprecated.protected AppProfiler
Deprecated.protected boolean
Deprecated.protected RenderManager
Deprecated.protected CompareMode
Deprecated.protected FrameBuffer[]
Deprecated.protected float
Deprecated.protected GeometryList
Deprecated.protected Texture2D[]
Deprecated.protected float
Deprecated.protected boolean
Deprecated.true to skip the post pass when there are no shadow castersprotected ViewPort
Deprecated.protected float
Deprecated.fade shadows at distance -
Constructor Summary
ModifierConstructorDescriptionprotected
Deprecated.used for serializationprotected
AbstractShadowRendererVR
(AssetManager assetManager, int shadowMapSize, int nbShadowMaps) Deprecated.Create an abstract shadow renderer. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
checkCulling
(Camera viewCam) Deprecated.returns true if the light source bounding box is in the view frustumvoid
cleanup()
Deprecated.Called when the SP is removed from the RM.protected abstract void
clearMaterialParameters
(Material material) Deprecated.This method is called once per frame and is responsible for clearing any material parameters that subclasses may need to clear on the post material.protected Geometry
createFrustum
(Vector3f[] pts, int i) Deprecated.debug function to create a visible frustumvoid
Deprecated.For debugging purposes, "snapshot" the current frustum to the scene.void
Deprecated.Force the frustum to be displayed.protected void
Deprecated.For debugging purposes, display depth shadow maps.protected void
doDisplayFrustumDebug
(int shadowMapIndex) Deprecated.responsible for displaying the frustum of the shadow cam for debug purposeDeprecated.Get the edge filtering mode.int
Deprecated.returns the edges thicknessprotected abstract GeometryList
getOccludersToRender
(int shadowMapIndex, GeometryList shadowMapOccluders) Deprecated.Returns a subclass-specific geometryList containing the occluders to be rendered in the shadow mapDeprecated.Returns the pre shadows pass render state.protected abstract void
getReceivers
(GeometryList lightReceivers) Deprecated.protected abstract Camera
getShadowCam
(int shadowMapIndex) Deprecated.return the shadow camera to use for rendering the shadow map according the given indexDeprecated.returns the shadow compare modefloat
Deprecated.Returns the shadow intensity.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
Deprecated.protected abstract void
Deprecated.delegates the initialization of the frustum cam to child renderersvoid
initialize
(RenderManager rm, ViewPort vp) Deprecated.Initialize this shadow renderer prior to its first update.boolean
Deprecated.This method does nothing now and is kept only for backward compatibility.boolean
Deprecated.Test whether this shadow renderer has been initialized.boolean
Deprecated.if this processor renders back faces shadowsvoid
postFrame
(FrameBuffer out) Deprecated.Called after a frame has been rendered and the queue flushed.void
postQueue
(RenderQueue rq) Deprecated.Called after the scene graph has been queued, but before it is flushed.void
preFrame
(float tpf) Deprecated.Called before a framevoid
read
(JmeImporter im) Deprecated.De-serialize this instance, for example when loading from a J3O file.protected void
renderShadowMap
(int shadowMapIndex) Deprecated.void
Deprecated.Called when the resolution of the viewport has been changed.final void
setEdgeFilteringMode
(EdgeFilteringMode filterMode) Deprecated.Sets the filtering mode for shadow edges.void
setEdgesThickness
(int edgesThickness) Deprecated.Sets the shadow edge thickness.protected abstract void
setMaterialParameters
(Material material) Deprecated.This method is called once per frame and is responsible for setting any material parameters that subclasses may need to set on the post material.protected final void
setPostShadowMaterial
(Material postShadowMat) Deprecated.set the post shadow material for this rendererprotected void
Deprecated.for internal use onlyvoid
setProfiler
(AppProfiler profiler) Deprecated.Sets a profiler Instance for this processor.void
setRenderBackFacesShadows
(Boolean renderBackFacesShadows) Deprecated.Set to true if you want back faces shadows on geometries.final void
setShadowCompareMode
(CompareMode compareMode) Deprecated.Sets the shadow compare mode.final void
setShadowIntensity
(float shadowIntensity) Deprecated.Set the shadowIntensity.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.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.protected abstract void
updateShadowCams
(Camera viewCam) Deprecated.Invoked once per frame to update the shadow cams according to the light view.void
write
(JmeExporter ex) Deprecated.Serialize this instance, for example when saving to a J3O file.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jme3.post.SceneProcessor
rescale
-
Field Details
-
nbShadowMaps
protected int nbShadowMapsDeprecated. -
shadowMapSize
protected float shadowMapSizeDeprecated. -
shadowIntensity
protected float shadowIntensityDeprecated. -
renderManager
Deprecated. -
viewPort
Deprecated. -
shadowFB
Deprecated. -
shadowMaps
Deprecated. -
dummyTex
Deprecated. -
preshadowMat
Deprecated. -
postshadowMat
Deprecated. -
lightViewProjectionsMatrices
Deprecated. -
assetManager
Deprecated. -
debug
protected boolean debugDeprecated. -
edgesThickness
protected float edgesThicknessDeprecated. -
edgeFilteringMode
Deprecated. -
shadowCompareMode
Deprecated. -
dispPic
Deprecated. -
forcedRenderState
Deprecated. -
renderBackFacesShadows
protected boolean renderBackFacesShadowsDeprecated. -
profiler
Deprecated. -
needsfallBackMaterial
protected boolean needsfallBackMaterialDeprecated.true if the fallback material should be used, otherwise false -
postTechniqueName
Deprecated.name of the post material technique -
matCache
Deprecated.list of materials for post shadow queue geometries -
lightReceivers
Deprecated. -
shadowMapOccluders
Deprecated. -
zFarOverride
protected float zFarOverrideDeprecated.fade shadows at distance -
fadeInfo
Deprecated. -
fadeLength
protected float fadeLengthDeprecated. -
frustumCam
Deprecated. -
skipPostPass
protected boolean skipPostPassDeprecated.true to skip the post pass when there are no shadow casters
-
-
Constructor Details
-
AbstractShadowRendererVR
protected AbstractShadowRendererVR()Deprecated.used for serialization -
AbstractShadowRendererVR
Deprecated.Create an abstract shadow renderer. Subclasses invoke this constructor.- Parameters:
assetManager
- the application asset managershadowMapSize
- the size of the rendered shadow maps (512,1024,2048, etc...)nbShadowMaps
- the number of shadow maps rendered (the more shadow maps the more quality, the fewer fps).
-
-
Method Details
-
initForcedRenderState
protected void initForcedRenderState()Deprecated. -
setPostShadowMaterial
Deprecated.set the post shadow material for this renderer- Parameters:
postShadowMat
-
-
setEdgeFilteringMode
Deprecated.Sets the filtering mode for shadow edges. SeeEdgeFilteringMode
for more info.- Parameters:
filterMode
- the desired filter mode (not null)
-
getEdgeFilteringMode
Deprecated.Get the edge filtering mode.- Returns:
- the edge filtering mode.
-
setShadowCompareMode
Deprecated.Sets the shadow compare mode. SeeCompareMode
for more info.- Parameters:
compareMode
- the desired compare mode (not null)
-
getShadowCompareMode
Deprecated.returns the shadow compare mode- Returns:
- the shadowCompareMode
- See Also:
-
createFrustum
Deprecated.debug function to create a visible frustum -
initialize
Deprecated.Initialize this shadow renderer prior to its first update.- Specified by:
initialize
in interfaceSceneProcessor
- Parameters:
rm
- the render managervp
- the viewport
-
initFrustumCam
protected abstract void initFrustumCam()Deprecated.delegates the initialization of the frustum cam to child renderers -
isInitialized
public boolean isInitialized()Deprecated.Test whether this shadow renderer has been initialized.- Specified by:
isInitialized
in interfaceSceneProcessor
- Returns:
- true if initialized, otherwise false
-
updateShadowCams
Deprecated.Invoked once per frame to update the shadow cams according to the light view.- Parameters:
viewCam
- the scene cam
-
getOccludersToRender
protected abstract GeometryList getOccludersToRender(int shadowMapIndex, GeometryList shadowMapOccluders) Deprecated.Returns a subclass-specific geometryList containing the occluders to be rendered in the shadow map- Parameters:
shadowMapIndex
- the index of the shadow map being renderedshadowMapOccluders
- the list of occluders- Returns:
- a list of occluders
-
getShadowCam
Deprecated.return the shadow camera to use for rendering the shadow map according the given index- Parameters:
shadowMapIndex
- the index of the shadow map being rendered- Returns:
- the shadowCam
-
setProfiler
Deprecated.Description copied from interface:SceneProcessor
Sets a profiler Instance for this processor.- Specified by:
setProfiler
in interfaceSceneProcessor
- Parameters:
profiler
- the profiler instance.
-
doDisplayFrustumDebug
protected void doDisplayFrustumDebug(int shadowMapIndex) Deprecated.responsible for displaying the frustum of the shadow cam for debug purpose- Parameters:
shadowMapIndex
-
-
postQueue
Deprecated.Description copied from interface:SceneProcessor
Called after the scene graph has been queued, but before it is flushed.- Specified by:
postQueue
in interfaceSceneProcessor
- Parameters:
rq
- The render queue
-
renderShadowMap
protected void renderShadowMap(int shadowMapIndex) Deprecated. -
displayFrustum
public void displayFrustum()Deprecated.Force the frustum to be displayed. -
displayShadowMap
Deprecated.For debugging purposes, display depth shadow maps. -
displayDebug
public void displayDebug()Deprecated.For debugging purposes, "snapshot" the current frustum to the scene. -
getReceivers
Deprecated. -
postFrame
Deprecated.Description copied from interface:SceneProcessor
Called after a frame has been rendered and the queue flushed.- Specified by:
postFrame
in interfaceSceneProcessor
- Parameters:
out
- The FB to which the scene was rendered.
-
clearMaterialParameters
Deprecated.This method is called once per frame and is responsible for clearing any material parameters that subclasses may need to clear on the post material.- Parameters:
material
- the material that was used for the post shadow pass
-
setMaterialParameters
Deprecated.This method is called once per frame and is responsible for setting any material parameters that subclasses may need to set on the post material.- Parameters:
material
- the material to use for the post shadow pass
-
setPostShadowParams
protected void setPostShadowParams()Deprecated.for internal use only -
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
-
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
-
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
-
checkCulling
Deprecated.returns true if the light source bounding box is in the view frustum- Returns:
- true if box in frustum
-
preFrame
public void preFrame(float tpf) Deprecated.Description copied from interface:SceneProcessor
Called before a frame- Specified by:
preFrame
in interfaceSceneProcessor
- 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 interfaceSceneProcessor
-
reshape
Deprecated.Description copied from interface:SceneProcessor
Called when the resolution of the viewport has been changed.- Specified by:
reshape
in interfaceSceneProcessor
- Parameters:
vp
- the affected ViewPortw
- the new width (in pixels)h
- the new height (in pixels)
-
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. The 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 edge thickness. Default is 1. Setting it to lower values can help to reduce the jagged effect of the shadow edges.- Parameters:
edgesThickness
- the shadow edge thickness.
-
isFlushQueues
Deprecated.This method does nothing now and is kept only for backward compatibility.This method does nothing now and is kept only for backward compatibility.- Returns:
false
-
getPreShadowForcedRenderState
Deprecated.Returns 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.
-
setRenderBackFacesShadows
Deprecated.Set to 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. Also note that setting this parameter will override this parameter for ALL materials in the scene. You can alternatively change this parameter on a single material usingMaterial.setBoolean(String, boolean)
This also will automatically adjust the faceCullMode and the PolyOffset of the pre shadow pass. You can modify them by usinggetPreShadowForcedRenderState()
- Parameters:
renderBackFacesShadows
- true or false.
-
isRenderBackFacesShadows
public boolean isRenderBackFacesShadows()Deprecated.if this processor renders back faces shadows- Returns:
- true if this processor renders back faces shadows
-
read
Deprecated.De-serialize this instance, for example when loading from a J3O file.- Specified by:
read
in interfaceSavable
- Parameters:
im
- importer (not null)- Throws:
IOException
-
write
Deprecated.Serialize this instance, for example when saving to a J3O file.- Specified by:
write
in interfaceSavable
- Parameters:
ex
- exporter (not null)- Throws:
IOException
-