org.xith3d.effects.shadows
Class ShadowFactory

java.lang.Object
  extended by org.xith3d.effects.shadows.ShadowFactory
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable
Direct Known Subclasses:
ShadowMappingFactory, VolumeShadowFactory

public abstract class ShadowFactory
extends java.lang.Object
implements org.jagatoo.datatypes.Enableable

The ShadowFactory is capable if creating the shadow system environment.


Nested Class Summary
static class ShadowFactory.ShadowFactoryIdentifier
           
 
Constructor Summary
ShadowFactory()
           
 
Method Summary
abstract  org.openmali.types.twodee.Sized2iRO getLightViewport()
           
abstract  ShadowAtom getShadowAtom(Node node)
          This is called by the FrustumCuller, if a Node with occluder has been detected within the frustum.
abstract  ShadowFactory.ShadowFactoryIdentifier getShadowFactoryId()
           
 int getShadowQuality()
           
 int getShadowSoftness()
           
 int getShadowTextureUnit()
           
 boolean isEnabled()
          
abstract  boolean needsPerLightCulling()
           
abstract  void onOccluderStateChanged(Node node, boolean isOccluder)
          This must be called from the scenegraph when a node's occluder state is changed.
abstract  void onShadowReceiverStateChanged(Shape3D shape, boolean isShadowReceiver)
          This must be called from the scenegraph when a shape's shadow-receiver state is changed.
 void setEnabled(boolean enabled)
          
 void setShadowQuality(int quality)
           
 void setShadowSoftness(int softness)
           
 void setShadowTextureUnit(int unit)
          Sets the texture-unit to use for the shadow map.
abstract  RenderPass setupRenderPass(View view, Light light, float viewportAspect, RenderBin shadowBin, long frameId, boolean justForCulling)
           
abstract  void verifyLight(Light light)
          Checks, if the Light is accepted as "shadow caster".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadowFactory

public ShadowFactory()
Method Detail

getShadowFactoryId

public abstract ShadowFactory.ShadowFactoryIdentifier getShadowFactoryId()
Returns:
the (partially) unique id, that maps the shadow-factory to the render-code.

setEnabled

public void setEnabled(boolean enabled)

Specified by:
setEnabled in interface org.jagatoo.datatypes.Enableable

isEnabled

public final boolean isEnabled()

Specified by:
isEnabled in interface org.jagatoo.datatypes.Enableable

setShadowTextureUnit

public void setShadowTextureUnit(int unit)
Sets the texture-unit to use for the shadow map.

Parameters:
unit -

getShadowTextureUnit

public final int getShadowTextureUnit()
Returns:
the texture-unit to use for the shadow map.

setShadowQuality

public void setShadowQuality(int quality)

getShadowQuality

public final int getShadowQuality()

getLightViewport

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

setShadowSoftness

public void setShadowSoftness(int softness)

getShadowSoftness

public final int getShadowSoftness()

verifyLight

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

Parameters:
light -

needsPerLightCulling

public abstract boolean needsPerLightCulling()
Returns:
whether this ShadowFactory needs per-light-frustum-culling.

setupRenderPass

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

getShadowAtom

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

Parameters:
node -

onOccluderStateChanged

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

Parameters:
node -
isOccluder -

onShadowReceiverStateChanged

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

Parameters:
shape -
isShadowReceiver -