XJRT Rendering Toolkit 1.0b06

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

java.lang.Object
  extended byorg.autochthonous.graphics.rt.Shader
      extended byorg.autochthonous.graphics.rt.shaders.CookTorranceShader
          extended byorg.autochthonous.graphics.rt.shaders.ct.Plastic
Direct Known Subclasses:
Bumpy, TurbulenceShader, WaveShader

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"
         refractiveIndex      %Float               "1"
         transparency          (%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 refractiveIndex
           
protected  float roughness
           
protected  Color3f specular
           
protected  Color3f transparency
           
protected  boolean transparentSurface
           
 
Fields inherited from class org.autochthonous.graphics.rt.shaders.CookTorranceShader
ambient
 
Fields inherited from class org.autochthonous.graphics.rt.Shader
alpha, name, 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.
 boolean isTransparent()
          return whether, or not, the surface is transparent.
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 setRefractiveIndex(double refractiveIndex)
          set the refractive index for the surface.
 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 setTransparency(Color3f c)
          set the transparent component for this surface.
 void setTransparency(double r, double g, double b)
          set the transparent component for this surface.
 void shade(Hit hit, Pixel p)
          the shade routine.
 
Methods inherited from class org.autochthonous.graphics.rt.shaders.CookTorranceShader
ambientContribution, diffuseContribution, setAmbient, setAmbient, specularContribution
 
Methods inherited from class org.autochthonous.graphics.rt.Shader
clamp, getName, 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

transparency

protected Color3f transparency

roughness

protected float roughness

reflectionRoughness

protected float reflectionRoughness

refractiveIndex

protected float refractiveIndex

reflectingSurface

protected boolean reflectingSurface

transparentSurface

protected boolean transparentSurface

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
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.


setRefractiveIndex

public void setRefractiveIndex(double refractiveIndex)
set the refractive index for the surface.


setTransparency

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


setTransparency

public void setTransparency(Color3f c)
set the transparent component for this surface.


isTransparent

public boolean isTransparent()
return whether, or not, the surface is transparent.


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.

Specified by:
shade in class CookTorranceShader

XJRT Rendering Toolkit 1.0b06