Bouncy Castle Rendering Toolkit 1.0

org.bouncycastle.graphics.rt.shaders.ct
Class Plastic

java.lang.Object
  |
  +--org.bouncycastle.graphics.rt.Shader
        |
        +--org.bouncycastle.graphics.rt.shaders.CookTorranceShader
              |
              +--org.bouncycastle.graphics.rt.shaders.ct.Plastic
Direct Known Subclasses:
TurbulenceShader

public class Plastic
extends CookTorranceShader

A plastic surface shader.

Example:

      <Plastic diffuse="0.2" specular="0.2" roughness="0.14" reflectance="0.8"/>
 

Document Type Definition:

     <!ENTITY %Float    "CDATA">
     <!ENTITY %Color3f  "CDATA">

     <!ELEMENT Plastic>
     <!ATTLIST Plastic
         ambient              (%Color3f; | %Float;) "0, 0, 0"
         diffuse              (%Color3f; | %Float;) "1, 1, 1"
         specular             (%Color3f; | %Float;) "0, 0, 0"
         roughness            %Float                "0"
         reflectance          (%Color3f; | %Float;) "0, 0, 0"
         reflectionRoughness  %Float                "0">
 


Field Summary
protected  Color3f diffuse
           
protected  int maxLevel
           
protected  Color3f reflectance
           
protected  boolean reflectingSurface
           
protected  float reflectionRoughness
           
protected  float roughness
           
protected  Color3f specular
           
 
Fields inherited from class org.bouncycastle.graphics.rt.shaders.CookTorranceShader
ambient
 
Fields inherited from class org.bouncycastle.graphics.rt.Shader
alpha, trans, world
 
Constructor Summary
Plastic(World world)
           
 
Method Summary
static Shader getInstance(World world, RMLReader in)
           
 boolean isReflecting()
          return whether, or not, the surface is reflecting.
 boolean isSpecular()
          return whether, or not, the surface is specular.
protected  void processParameters(ParametersMap params)
          apply the default parameters for a shader, from the passed in parameters table.
 void setDiffuse(Color3f c)
          set the diffuse components for this object
 void setDiffuse(double kD)
          set the diffuse components for this object
 void setDiffuse(double r, double g, double b)
          set the diffuse components for this object
 void setReflectance(Color3f c)
          set the reflective component for this surface.
 void setReflectance(double r, double g, double b)
          set the reflective component for this surface.
 void setReflectionRoughness(double reflectionRoughness)
           
 void setRoughness(double roughness)
          set the roughness of the surface, the smaller we are the more refined the specular highlights.
 void setSpecular(Color3f c)
          set the specular components for this object
 void shade(Hit hit, Pixel p)
          the shade routine.
 
Methods inherited from class org.bouncycastle.graphics.rt.shaders.CookTorranceShader
ambientContribution, diffuseContribution, setAmbient, setAmbient, specularContribution
 
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

diffuse

protected Color3f diffuse

specular

protected Color3f specular

reflectance

protected Color3f reflectance

roughness

protected float roughness

reflectionRoughness

protected float reflectionRoughness

reflectingSurface

protected boolean reflectingSurface

maxLevel

protected int maxLevel
Constructor Detail

Plastic

public Plastic(World world)
Method Detail

getInstance

public static Shader getInstance(World world,
                                 RMLReader in)
                          throws java.io.IOException

processParameters

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

setDiffuse

public void setDiffuse(double kD)
set the diffuse components for this object

setDiffuse

public void setDiffuse(double r,
                       double g,
                       double b)
set the diffuse components for this object

setDiffuse

public void setDiffuse(Color3f c)
set the diffuse components for this object

setSpecular

public void setSpecular(Color3f c)
set the specular components for this object

setRoughness

public void setRoughness(double roughness)
set the roughness of the surface, the smaller we are the more refined the specular highlights.

isSpecular

public boolean isSpecular()
return whether, or not, the surface is specular.

setReflectance

public void setReflectance(double r,
                           double g,
                           double b)
set the reflective component for this surface.

setReflectance

public void setReflectance(Color3f c)
set the reflective component for this surface.

isReflecting

public boolean isReflecting()
return whether, or not, the surface is reflecting.

setReflectionRoughness

public void setReflectionRoughness(double reflectionRoughness)

shade

public void shade(Hit hit,
                  Pixel p)
the shade routine. If you want more than the below, this is the method to override.
Overrides:
shade in class CookTorranceShader

Bouncy Castle Rendering Toolkit 1.0