LibTrace
Programming - The Surface class
The "Surface
" class simply stores the details for any particular point on a texture. It has the following variables:
Vector normal
- This stores the bump normal. Unless bump mapping is present in the
texture then this will be Vector(0, 0, 0)
.
rgb color
- This stores the color of the surface. This affects the color of any filtered
light due to transparency or refraction and also the diffusive color of the surface.
double diffuse
- This sets the diffusive level of the surface. 0 means no light is reflected diffusively
and 1 means that all the light is reflected diffusively.
double transparency
- This sets how much light passes straight through the surface.
double reflect
- This sets how much light is reflected.
double refract
- This sets how much light is refracted into the surface, ie glass/water.
double ior
- This is used alongside refract
to set the index of refraction of the surface.
The "Surface
" class doesn't have any special functions but has the arithmetic operators "+
" and
"*
" overloaded.