#include <WoodShader.h>
Inherits ProceduralShader.
Inheritance diagram for WoodShader:
Public Member Functions | |
WoodShader (Scene *scene, const RGBAColor &color=RGBAColor(0.47, 0.23, 0.07)) | |
RGBAColor | shade (const Ray &ray) const |
Private Attributes | |
PerlinNoise | mMarkPerlin |
RGBAColor | mColor |
color for the wood |
TODO transform hit point to local coordinates of the object and use it in 3D-PerlinNoise
Definition at line 15 of file WoodShader.h.
WoodShader::WoodShader | ( | Scene * | scene, | |
const RGBAColor & | color = RGBAColor(0.47, 0.23, 0.07) | |||
) | [inline] |
Constructor
scene | The scene which this shader belongs to | |
color | The base color for the sky |
Definition at line 22 of file WoodShader.h.
normal shade method with a atmospheric scattering effect by using linear interpolation
ray | The ray which hits the primitive |
Implements Shader.
Definition at line 33 of file WoodShader.h.
References EPSILON, Ray::hit(), Ray::hitPoint(), lerp(), LOG, max(), mColor, min(), mMarkPerlin, ProceduralShader::mPerlin, PerlinNoise::perlinNoise3D(), TexCoordinate::setY(), Primitive::texCoord(), Vec3f::x(), TexCoordinate::x(), Vec3f::y(), TexCoordinate::y(), and Vec3f::z().
PerlinNoise WoodShader::mMarkPerlin [private] |
RGBAColor WoodShader::mColor [private] |