#ifndef REFRACTIONSHADER_H #define REFRACTIONSHADER_H #include "shader/shader.h" class RefractionShader : public Shader { public: // Constructor RefractionShader(float indexInside, float indexOutside, Color const &objectColor = Color(1, 1, 1), float lightLoss = 0); // Shader functions Color shade(Scene const &scene, Ray const &ray) const override; bool isTransparent() const override; Color transparency(const Scene &scene, const Ray &ray, float maxLength) const override; private: float indexInside; float indexOutside; float lightLoss; Color objectColor; float remainingLightIntensity(float distanceThroughObject) const; }; #endif