de.grogra.imp3d.shading
Class SideSwitchShader

java.lang.Object
  extended by de.grogra.persistence.ShareableBase
      extended by de.grogra.imp3d.shading.SwitchShader
          extended by de.grogra.imp3d.shading.SideSwitchShader
All Implemented Interfaces:
Manageable, Shareable, Scattering, Shader

public class SideSwitchShader
extends SwitchShader


Nested Class Summary
static class SideSwitchShader.Type
           
 
Field Summary
static SideSwitchShader.Type $TYPE
           
static SCOType.Field backShader$FIELD
           
static SCOType.Field frontShader$FIELD
           
 
Fields inherited from interface de.grogra.ray.physics.Shader
LAMBERTIAN_VARIANCE
 
Fields inherited from interface de.grogra.ray.physics.Scattering
DELTA_FACTOR, IS_NON_OPAQUE, MIN_UNUSED_FLAG, NEEDS_NORMAL, NEEDS_POINT, NEEDS_TANGENTS, NEEDS_TRANSFORMATION, NEEDS_UV, RANDOM_RAYS_GENERATE_ORIGINS
 
Constructor Summary
SideSwitchShader()
           
SideSwitchShader(Shader frontShader)
           
SideSwitchShader(Shader frontShader, Shader backShader)
           
 
Method Summary
 void accept(ShaderVisitor visitor)
           
 int getAverageColor()
          Returns an average color for the scattering entity.
 Shader getBackShader()
           
 int getFlags()
           
 Shader getFrontShader()
           
 ManageableType getManageableType()
           
protected  Shader getShaderFor(Environment env, Vector3f in)
          This method has to be implemented by subclasses and defines the actual shader which shall be used depending on the environment and the ray direction.
 boolean isTransparent()
           
 void setBackShader(Shader value)
           
 void setFrontShader(Shader value)
           
 void setShaders(Shader front, Shader back)
           
 
Methods inherited from class de.grogra.imp3d.shading.SwitchShader
computeBSDF, computeMaxRays, generateRandomRays, shade, transformEnvironment
 
Methods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

$TYPE

public static final SideSwitchShader.Type $TYPE

backShader$FIELD

public static final SCOType.Field backShader$FIELD

frontShader$FIELD

public static final SCOType.Field frontShader$FIELD
Constructor Detail

SideSwitchShader

public SideSwitchShader()

SideSwitchShader

public SideSwitchShader(Shader frontShader)

SideSwitchShader

public SideSwitchShader(Shader frontShader,
                        Shader backShader)
Method Detail

accept

public void accept(ShaderVisitor visitor)

getAverageColor

public int getAverageColor()
Description copied from interface: Scattering
Returns an average color for the scattering entity. This color is used for simplified graphical representations of the corresponding objects.

Returns:
an average color in Java's default sRGB color space, encoded as an int (0xAARRGGBB).

getBackShader

public Shader getBackShader()

getFlags

public int getFlags()

getFrontShader

public Shader getFrontShader()

getManageableType

public ManageableType getManageableType()

getShaderFor

protected Shader getShaderFor(Environment env,
                              Vector3f in)
Description copied from class: SwitchShader
This method has to be implemented by subclasses and defines the actual shader which shall be used depending on the environment and the ray direction.

Specified by:
getShaderFor in class SwitchShader
Parameters:
env - environment for which shading computations are to be performed
in - given ray direction
Returns:
actual shader to use for shading computations

isTransparent

public boolean isTransparent()
Specified by:
isTransparent in interface Shader
Overrides:
isTransparent in class SwitchShader

setBackShader

public void setBackShader(Shader value)

setFrontShader

public void setFrontShader(Shader value)

setShaders

public void setShaders(Shader front,
                       Shader back)