cloudy-raytracer/shader/toneshader.h

35 lines
822 B
C++

#ifndef CG1_TRACER_TONESHADER_H
#define CG1_TRACER_TONESHADER_H
#include "common/color.h"
#include "shader.h"
#include "light/light.h"
#include "scene/scene.h"
class ToneShader : public Shader
{
public:
// Constructor
ToneShader(std::shared_ptr<Light> light,
Color const &highlightColor = Color(1, 1, 1),
Color const &midtoneColor = Color(0.5, 0.5, 0.5),
Color const &shadowColor = Color(0, 0, 0),
float edgeFade = 1.0f);
// Shader functions
virtual Color shade(Scene const &scene, Ray const &ray) const;
protected:
Color const highlightColor;
Color const midtoneColor;
Color const shadowColor;
float const edgeFade;
std::shared_ptr<Light> light; // Only one light is supported
};
#endif //CG1_TRACER_TONESHADER_H