org.xith3d.effects.shadows
Class VolumeShadowFactory

java.lang.Object
  extended by org.xith3d.effects.shadows.ShadowFactory
      extended by org.xith3d.effects.shadows.VolumeShadowFactory
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable

public class VolumeShadowFactory
extends ShadowFactory

The VolumeShadowFactory uses shadow volumes to generate shadows.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.xith3d.effects.shadows.ShadowFactory
ShadowFactory.ShadowFactoryIdentifier
 
Field Summary
static ShadowFactory.ShadowFactoryIdentifier SHADOW_FACTORY_ID
           
 
Constructor Summary
VolumeShadowFactory()
           
 
Method Summary
 org.openmali.vecmath2.Point3f getLightSourcePosition()
           
 org.openmali.types.twodee.Sized2iRO getLightViewport()
          
protected  void getOccluderSubmission(Node node, java.util.List<OccluderSubmission> list)
          Calculates a list of the occluder shapes in the tree.
 ShadowAtom getShadowAtom(Node node)
          This is called by the FrustumCuller, if a Node with occluder has been detected within the frustum.
 ShadowFactory.ShadowFactoryIdentifier getShadowFactoryId()
          
 boolean needsPerLightCulling()
          
 void onOccluderStateChanged(Node node, boolean isOccluder)
          This must be called from the scenegraph when a node's occluder state is changed.
 void onShadowReceiverStateChanged(Shape3D shape, boolean isShadowReceiver)
          This must be called from the scenegraph when a shape's shadow-receiver state is changed.
 void setLightSourcePosition(org.openmali.vecmath2.Tuple3f pos)
           
 RenderPass setupRenderPass(View view, Light light, float viewportAspect, RenderBin shadowBin, long frameId, boolean justForCulling)
          
 void verifyLight(Light light)
          Checks, if the Light is accepted as "shadow caster".
 
Methods inherited from class org.xith3d.effects.shadows.ShadowFactory
getShadowQuality, getShadowSoftness, getShadowTextureUnit, isEnabled, setEnabled, setShadowQuality, setShadowSoftness, setShadowTextureUnit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHADOW_FACTORY_ID

public static final ShadowFactory.ShadowFactoryIdentifier SHADOW_FACTORY_ID
Constructor Detail

VolumeShadowFactory

public VolumeShadowFactory()
Method Detail

getShadowFactoryId

public ShadowFactory.ShadowFactoryIdentifier getShadowFactoryId()

Specified by:
getShadowFactoryId in class ShadowFactory
Returns:
the (partially) unique id, that maps the shadow-factory to the render-code.

setLightSourcePosition

public final void setLightSourcePosition(org.openmali.vecmath2.Tuple3f pos)

getLightSourcePosition

public final org.openmali.vecmath2.Point3f getLightSourcePosition()

verifyLight

public void verifyLight(Light light)
Checks, if the Light is accepted as "shadow caster". throws an ecception, if it is not accepted.

Specified by:
verifyLight in class ShadowFactory

needsPerLightCulling

public boolean needsPerLightCulling()

Specified by:
needsPerLightCulling in class ShadowFactory
Returns:
whether this ShadowFactory needs per-light-frustum-culling.

getLightViewport

public org.openmali.types.twodee.Sized2iRO getLightViewport()

Specified by:
getLightViewport in class ShadowFactory

setupRenderPass

public RenderPass setupRenderPass(View view,
                                  Light light,
                                  float viewportAspect,
                                  RenderBin shadowBin,
                                  long frameId,
                                  boolean justForCulling)

Specified by:
setupRenderPass in class ShadowFactory

getShadowAtom

public ShadowAtom getShadowAtom(Node node)
This is called by the FrustumCuller, if a Node with occluder has been detected within the frustum.

Specified by:
getShadowAtom in class ShadowFactory

getOccluderSubmission

protected final void getOccluderSubmission(Node node,
                                           java.util.List<OccluderSubmission> list)
Calculates a list of the occluder shapes in the tree.

Parameters:
list -

onOccluderStateChanged

public void onOccluderStateChanged(Node node,
                                   boolean isOccluder)
This must be called from the scenegraph when a node's occluder state is changed.

Specified by:
onOccluderStateChanged in class ShadowFactory

onShadowReceiverStateChanged

public void onShadowReceiverStateChanged(Shape3D shape,
                                         boolean isShadowReceiver)
This must be called from the scenegraph when a shape's shadow-receiver state is changed.

Specified by:
onShadowReceiverStateChanged in class ShadowFactory