From b26a0168788a28c384d394b9e3bb4ebaebc815c2 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 16 Apr 2022 14:31:38 +0800 Subject: Add dielectric material. (glass ball) --- material_dielectric.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 material_dielectric.h (limited to 'material_dielectric.h') 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 -- cgit v1.2.3