|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.renderer.pass.Pass
com.jme.renderer.pass.ShadowedRenderPass
public class ShadowedRenderPass
ShadowedRenderPass
is a render pass that renders the added
spatials along with shadows cast by givens occluders and lights flagged as
casting shadows.
Nested Class Summary | |
---|---|
static class |
ShadowedRenderPass.LightingMethod
|
Field Summary | |
---|---|
static BlendState |
alphaBlended
|
static BlendState |
blended
|
static BlendState |
blendTex
|
protected static ColorMaskState |
colorDisabled
|
protected static ColorMaskState |
colorEnabled
|
protected static CullState |
cullBackFace
|
protected static CullState |
cullFrontFace
|
protected static ZBufferState |
forColorPassTesting
|
protected static ZBufferState |
forTesting
|
protected boolean |
initialised
whether or not the renderstates for this pass have been init'd yet. |
protected ShadowedRenderPass.LightingMethod |
lightingMethod
Sets the type of pass to do to show shadows - ADDITIVE or MODULATIVE |
protected static LightState |
lights
|
protected java.util.IdentityHashMap<TriMesh,MeshShadows> |
meshes
collection of TriMesh to MeshShadows mappings |
static BlendState |
modblended
|
protected static CullState |
noCull
|
protected static LightState |
noLights
|
protected static StencilState |
noStencil
|
protected static TextureState |
noTexture
|
protected java.util.ArrayList<TriMesh> |
occluderMeshes
list of occluders that will be casting shadows in this pass. |
protected java.util.ArrayList<Spatial> |
occluders
list of occluders registered with this pass. |
protected RenderState[] |
preStates
a place to internally save previous enforced states setup before rendering this pass |
protected int |
quadHeight
|
protected int |
quadWidth
|
protected boolean |
renderShadows
Whether to render shadows (true) or act like a normal RenderPass (false) |
protected boolean |
renderVolume
Whether shadow volumes are visible |
static boolean |
rTexture
|
protected ColorRGBA |
shadowColor
Used with MODULATIVE lightMethod. |
protected java.util.ArrayList<Light> |
shadowLights
list of lights that will be used to calculate shadows in this pass. |
protected Quad |
shadowQuad
A quad to use with MODULATIVE lightMethod for full screen darkening against the shadow stencil. |
protected static StencilState |
stencilBackFaces
|
protected static StencilState |
stencilBothFaces
|
protected static StencilState |
stencilDrawOnlyWhenSet
|
protected static StencilState |
stencilDrawWhenNotSet
|
protected static StencilState |
stencilFrontFaces
|
protected Node |
volumeNode
node used to gather and hold shadow volumes for rendering. |
protected static ZBufferState |
zbufferAlways
|
protected static ZBufferState |
zbufferWriteLE
|
Fields inherited from class com.jme.renderer.pass.Pass |
---|
context, enabled, passStates, savedStates, spatials, zFactor, zOffset |
Constructor Summary | |
---|---|
ShadowedRenderPass()
|
Method Summary | |
---|---|
void |
addOccluder(Spatial toAdd)
addOccluder adds an occluder to this pass. |
protected void |
addShadowVolumes(Light light)
addShadowVolumes adds the shadow volumes for a given light
to volumeNode |
protected void |
cleanup()
|
void |
clearOccluders()
clearOccluders removes all occluders from this pass. |
boolean |
containsOccluder(Spatial s)
containsOccluder |
void |
doRender(Renderer r)
doRender renders this pass to the framebuffer |
protected void |
drawVolumes(Renderer r)
drawVolumes is a debug method used to draw the shadow
volumes currently in use in the pass. |
protected void |
generateVolumes()
|
ShadowedRenderPass.LightingMethod |
getLightingMethod()
|
boolean |
getRenderShadows()
|
boolean |
getRenderVolume()
|
ColorRGBA |
getShadowColor()
|
ShadowGate |
getShadowGate()
|
protected void |
getShadowLights()
|
protected void |
getShadowLights(Spatial s)
|
protected void |
init()
|
protected void |
maskShadowLights(int mask)
|
int |
occludersSize()
|
boolean |
removeOccluder(Spatial toRemove)
removeOccluder |
protected void |
renderScene(Renderer r)
|
protected void |
replaceEnforcedStates()
replaces any states enforced by the user at the end of the pass. |
void |
resetShadowQuad(Renderer r)
|
protected void |
saveEnforcedStates()
saves any states enforced by the user for replacement at the end of the pass. |
void |
setLightingMethod(ShadowedRenderPass.LightingMethod method)
Sets which method to use with the shadow volume stencils in order to generate shadows in the scene. |
void |
setRenderShadows(boolean renderShadows)
|
void |
setRenderVolume(boolean renderVolume)
|
void |
setShadowColor(ColorRGBA shadowColor)
|
void |
setShadowGate(ShadowGate shadowCheck)
|
protected void |
setupOccluderMeshes()
|
protected void |
setupOccluderMeshes(Spatial spat)
|
protected void |
unmaskShadowLights()
|
Methods inherited from class com.jme.renderer.pass.Pass |
---|
add, applyPassStates, cleanUp, clearPassState, clearPassState, clearPassStates, contains, doUpdate, get, getRenderState, getRenderState, getZFactor, getZOffset, isEnabled, remove, removeAll, renderPass, resetOldStates, setEnabled, setPassState, setZFactor, setZOffset, size, updatePass |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList<Spatial> occluders
protected Node volumeNode
protected boolean initialised
protected Quad shadowQuad
protected ColorRGBA shadowColor
protected boolean renderVolume
protected boolean renderShadows
protected ShadowedRenderPass.LightingMethod lightingMethod
protected java.util.IdentityHashMap<TriMesh,MeshShadows> meshes
protected java.util.ArrayList<TriMesh> occluderMeshes
protected java.util.ArrayList<Light> shadowLights
protected RenderState[] preStates
protected int quadWidth
protected int quadHeight
public static boolean rTexture
protected static ZBufferState zbufferWriteLE
protected static ZBufferState zbufferAlways
protected static ZBufferState forTesting
protected static ZBufferState forColorPassTesting
protected static StencilState noStencil
protected static StencilState stencilFrontFaces
protected static StencilState stencilBothFaces
protected static StencilState stencilBackFaces
protected static StencilState stencilDrawOnlyWhenSet
protected static StencilState stencilDrawWhenNotSet
protected static CullState cullFrontFace
protected static CullState cullBackFace
protected static CullState noCull
protected static TextureState noTexture
protected static LightState lights
protected static LightState noLights
public static BlendState blended
public static BlendState alphaBlended
public static BlendState modblended
public static BlendState blendTex
protected static ColorMaskState colorEnabled
protected static ColorMaskState colorDisabled
Constructor Detail |
---|
public ShadowedRenderPass()
Method Detail |
---|
public void addOccluder(Spatial toAdd)
addOccluder
adds an occluder to this pass.
toAdd
- Occluder Spatial to add to this pass.public void clearOccluders()
clearOccluders
removes all occluders from this pass.
public boolean containsOccluder(Spatial s)
containsOccluder
s
-
public boolean removeOccluder(Spatial toRemove)
removeOccluder
toRemove
- the Occluder Spatial to remove from this pass.
public int occludersSize()
public boolean getRenderVolume()
public void setRenderVolume(boolean renderVolume)
renderVolume
- sets whether shadow volumes will be rendered to the displaypublic boolean getRenderShadows()
public void setRenderShadows(boolean renderShadows)
renderShadows
- whether shadows will be rendered by this pass.public ColorRGBA getShadowColor()
public void setShadowColor(ColorRGBA shadowColor)
shadowColor
- the shadowColor used by MODULATIVE lightMethod.public ShadowedRenderPass.LightingMethod getLightingMethod()
public void setLightingMethod(ShadowedRenderPass.LightingMethod method)
method
- method to use
java.lang.IllegalArgumentException
- if method is nullpublic void doRender(Renderer r)
doRender
renders this pass to the framebuffer
doRender
in class Pass
r
- Renderer to use for drawing.Pass.doRender(com.jme.renderer.Renderer)
protected void cleanup()
protected void maskShadowLights(int mask)
protected void unmaskShadowLights()
protected void renderScene(Renderer r)
protected void getShadowLights()
protected void getShadowLights(Spatial s)
protected void setupOccluderMeshes()
protected void setupOccluderMeshes(Spatial spat)
protected void saveEnforcedStates()
protected void replaceEnforcedStates()
protected void generateVolumes()
protected void addShadowVolumes(Light light)
addShadowVolumes
adds the shadow volumes for a given light
to volumeNode
light
- the light whose volumes should be addedprotected void drawVolumes(Renderer r)
drawVolumes
is a debug method used to draw the shadow
volumes currently in use in the pass.
r
- Renderer to draw with.protected void init()
public void resetShadowQuad(Renderer r)
public ShadowGate getShadowGate()
public void setShadowGate(ShadowGate shadowCheck)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |