Bouncy Castle Rendering Toolkit 1.0

org.bouncycastle.graphics.rt.shaders
Class CookTorranceShader

java.lang.Object
  |
  +--org.bouncycastle.graphics.rt.Shader
        |
        +--org.bouncycastle.graphics.rt.shaders.CookTorranceShader
Direct Known Subclasses:
Ambient, Matte, Metal, Plastic

public abstract class CookTorranceShader
extends Shader

a general purpose Cook-Torrance shader. Contains all the standard attributes.


Field Summary
protected  Color3f ambient
           
 
Fields inherited from class org.bouncycastle.graphics.rt.Shader
alpha, trans, world
 
Constructor Summary
CookTorranceShader(World world)
           
 
Method Summary
protected  Color3f ambientContribution(World world)
          return the ambient contribution of the given world to this surface.
protected  Color3f diffuseContribution(LightDataList contribs, Hit hit)
          return the diffuse contribution of the given world to this hit.
protected  void processParameters(ParametersMap params)
          apply the default parameters for a shader, from the passed in parameters table.
 void setAmbient(Color3f c)
          set the ambient color for this object (usually multiplied with the base color).
 void setAmbient(double r, double g, double b)
          set the ambient color for this object (usually multiplied with the base color).
abstract  void shade(Hit hit, Pixel p)
          the shade routine.
protected  Color3f specularContribution(LightDataList contribs, Hit hit, float roughness)
          return the specular contribution of the given world to this hit, calculated according to the given roughness.
 
Methods inherited from class org.bouncycastle.graphics.rt.Shader
clamp, processObject, readObject, setAlpha, toShaderSpace, toShaderSpace, transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ambient

protected Color3f ambient
Constructor Detail

CookTorranceShader

public CookTorranceShader(World world)
Method Detail

processParameters

protected void processParameters(ParametersMap params)
apply the default parameters for a shader, from the passed in parameters table.
Overrides:
processParameters in class Shader

ambientContribution

protected Color3f ambientContribution(World world)
return the ambient contribution of the given world to this surface.

diffuseContribution

protected Color3f diffuseContribution(LightDataList contribs,
                                      Hit hit)
return the diffuse contribution of the given world to this hit.

specularContribution

protected Color3f specularContribution(LightDataList contribs,
                                       Hit hit,
                                       float roughness)
return the specular contribution of the given world to this hit, calculated according to the given roughness.

setAmbient

public void setAmbient(double r,
                       double g,
                       double b)
set the ambient color for this object (usually multiplied with the base color).

setAmbient

public void setAmbient(Color3f c)
set the ambient color for this object (usually multiplied with the base color).

shade

public abstract void shade(Hit hit,
                           Pixel p)
the shade routine.
Overrides:
shade in class Shader

Bouncy Castle Rendering Toolkit 1.0