#include <checker.h>
Inherits Material.
Inheritance diagram for Checker:
Public Member Functions | |
Checker (Material *m1, Material *m2, int nu, int nv) | |
Constructs a checkerboard material consisting of two sub-materials, one for odd and one for even squares. | |
virtual | ~Checker () |
Destructor. | |
Color | getBRDF (const Intersection &is, const Vector &L) |
Returns the BRDF at the intersection is for the light direction L. | |
float | getReflectivity (const Intersection &is) const |
Returns the reflectivity of the material in the range [0,1], where 0 means not reflective at all, and 1 gives a perfect mirror. | |
float | getTransparency (const Intersection &is) const |
Returns the transparency of the material in the range [0,1], where 0 is fully opaque, and 1 is fully transparent. | |
virtual void | setReflectivity (float r) |
Sets the reflectivity of the material. | |
virtual void | setTransparency (float t) |
Sets the transparency of the material. | |
Protected Member Functions | |
int | getType (const Intersection &is) const |
Returns the type of the checker at the intersection point, 0 or 1, where 0 is even squares and 1 is odd. | |
Protected Attributes | |
Material * | mMat [2] |
The two materials. | |
int | mNumU |
Number of squares along u. | |
int | mNumV |
Number of squares along v. | |
float | mReflectivity |
The reflectivity of the material. | |
float | mTransparency |
The transparency of the material. |
This material takes two materials, and alternately chooses between them based on the texture coordinates.