diff options
Diffstat (limited to 'material_dielectric.h')
-rw-r--r-- | material_dielectric.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/material_dielectric.h b/material_dielectric.h new file mode 100644 index 0000000..48382b4 --- /dev/null +++ b/material_dielectric.h @@ -0,0 +1,18 @@ +// +// Created by Keuin on 2022/4/15. +// + +#ifndef RT_MATERIAL_DIELECTRIC_H +#define RT_MATERIAL_DIELECTRIC_H + +#include "vec.h" +#include "material.h" + +class material_dielectric : public material { + double ri_inv; +public: + explicit material_dielectric(double ri) : ri_inv{1.0 / ri} {} + bool scatter(ray3d &r, const object &hit_obj, double hit_t, random_uv_gen_3d &ruvg) const override; +}; + +#endif //RT_MATERIAL_DIELECTRIC_H |