cloudy-raytracer/shader/cooktorranceshader.h

26 lines
631 B
C
Raw Normal View History

2022-11-25 14:58:29 +01:00
#ifndef COOKTORRANCESHADER_H
#define COOKTORRANCESHADER_H
#include "shader/shader.h"
class CookTorranceShader : public Shader {
public:
CookTorranceShader(Color const &diffuseColor, Color const &ctColor, float IOR, float roughness,
float diffuseCoefficient = PI / 2.0f, float ctCoefficient = PI / 2.0f);
// Shader functions
Color shade(Scene const &scene, Ray const &ray) const override;
private:
float D(float NdotH) const;
float F(float VdotH) const;
float G(float NdotH, float NdotV, float VdotH, float NdotL) const;
Color diffuseColor;
Color ctColor;
float F0;
float m;
};
#endif