|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.shadow.PssmShadowRenderer
public class PssmShadowRenderer
PssmShadow renderer use Parrallel 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 result in a better quality shadow than standard shadow mapping.
for
more informations on this read this
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
Nested Class Summary | |
---|---|
static class |
PssmShadowRenderer.CompareMode
Specifies the shadow comparison mode |
static class |
PssmShadowRenderer.FilterMode
FilterMode specifies how shadows are filtered |
Constructor Summary | |
---|---|
PssmShadowRenderer(AssetManager manager,
int size,
int nbSplits)
Create a PSSM Shadow Renderer More info on the technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html |
|
PssmShadowRenderer(AssetManager manager,
int size,
int nbSplits,
Material postShadowMat)
Create a PSSM Shadow Renderer More info on the technique at http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html |
Method Summary | |
---|---|
void |
cleanup()
Called when the SP is removed from the RM. |
void |
displayDebug()
For dubuging purpose Allow to "snapshot" the current frustrum to the scene |
Vector3f |
getDirection()
returns the light direction used by the processor |
int |
getEdgesThickness()
returns the edges thickness see setEdgesThickness(int edgesThickness) |
float |
getLambda()
returns the labda parameter see setLambda(float lambda) |
float |
getShadowIntensity()
returns the shdaow intensity see setShadowIntensity(float shadowIntensity) |
float |
getShadowZExtend()
How far the shadows are rendered in the view see setShadowZExtend(float zFar) |
void |
initialize(RenderManager rm,
ViewPort vp)
Called in the render thread to initialize the scene processor. |
boolean |
isFlushQueues()
returns true if the PssmRenderer flushed the shadow queues |
boolean |
isInitialized()
|
void |
postFrame(FrameBuffer out)
Called after a frame has been rendered and the queue flushed. |
void |
postQueue(RenderQueue rq)
Called after the scene graph has been queued, but before it is flushed. |
void |
preFrame(float tpf)
Called before a frame |
void |
reshape(ViewPort vp,
int w,
int h)
Called when the resolution of the viewport has been changed. |
void |
setCompareMode(PssmShadowRenderer.CompareMode compareMode)
sets the shadow compare mode see PssmShadowRenderer.CompareMode for more info |
void |
setDirection(Vector3f direction)
Sets the light direction to use to compute shadows |
void |
setEdgesThickness(int edgesThickness)
Sets the shadow edges thickness. |
void |
setFilterMode(PssmShadowRenderer.FilterMode filterMode)
Sets the filtering mode for shadow edges see PssmShadowRenderer.FilterMode for more info |
void |
setFlushQueues(boolean flushQueues)
Set this to false if you want to use several PssmRederers to have multiple shadows cast by multiple light sources. |
void |
setLambda(float lambda)
|
void |
setShadowIntensity(float shadowIntensity)
Set the shadowIntensity, the value should be between 0 and 1, a 0 value gives a bright and invisilble 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 dynamicaly computed to the shadow casters/receivers union bound zFar, capped to view frustum far value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PssmShadowRenderer(AssetManager manager, int size, int nbSplits)
manager
- the application asset managersize
- 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).nbSplits
- the number of shadow maps rendered (the more shadow maps the more quality, the less fps).public PssmShadowRenderer(AssetManager manager, int size, int nbSplits, Material postShadowMat)
manager
- the application asset managersize
- 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 Detail |
---|
public final void setFilterMode(PssmShadowRenderer.FilterMode filterMode)
PssmShadowRenderer.FilterMode
for more info
filterMode
- public final void setCompareMode(PssmShadowRenderer.CompareMode compareMode)
PssmShadowRenderer.CompareMode
for more info
compareMode
- public void initialize(RenderManager rm, ViewPort vp)
SceneProcessor
initialize
in interface SceneProcessor
rm
- The render manager to which the SP was added tovp
- The viewport to which the SP is assignedpublic boolean isInitialized()
isInitialized
in interface SceneProcessor
public Vector3f getDirection()
public void setDirection(Vector3f direction)
direction
- public void postQueue(RenderQueue rq)
SceneProcessor
postQueue
in interface SceneProcessor
rq
- The render queuepublic void displayDebug()
public void postFrame(FrameBuffer out)
SceneProcessor
postFrame
in interface SceneProcessor
out
- The FB to which the scene was rendered.public void preFrame(float tpf)
SceneProcessor
preFrame
in interface SceneProcessor
tpf
- Time per framepublic void cleanup()
SceneProcessor
cleanup
in interface SceneProcessor
public void reshape(ViewPort vp, int w, int h)
SceneProcessor
reshape
in interface SceneProcessor
public float getLambda()
setLambda(float lambda)
public void setLambda(float lambda)
public float getShadowZExtend()
setShadowZExtend(float zFar)
public void setShadowZExtend(float zFar)
zFar
- the zFar values that override the computed onepublic 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
- public boolean isFlushQueues()
public void setFlushQueues(boolean flushQueues)
flushQueues
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |