From 2db0d27e7f1744443958717c19b732eed57455f2 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sat, 9 Jan 2021 20:42:24 +0100 Subject: Replace old classes with compute shader structs --- include/material.hpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'include/material.hpp') diff --git a/include/material.hpp b/include/material.hpp index 5e6f095..10886da 100644 --- a/include/material.hpp +++ b/include/material.hpp @@ -1,13 +1,20 @@ #ifndef __MATERIAL_HPP_ #define __MATERIAL_HPP_ -#include "ray.hpp" +#include "vec3.hpp" -struct hit_info; +enum MATERIAL_TYPE: uint32_t { + LAMBERTIAN = 0, + METAL = 1, + DIELECTRIC = 2, +}; -class material { - public: - virtual bool scatter(const ray& r, const struct hit_info& info, color& attenuation, ray& scaterred) const = 0; +struct material { + color albedo; + float fuzz; + float ior; + uint32_t type; + uint32_t padding; }; #endif // !__MATERIAL_HPP_ -- cgit v1.3