Skip to content
Snippets Groups Projects
Material.h 655 B
Newer Older
Postea's avatar
Postea committed
#pragma once
Yoel's avatar
Yoel committed
#include <random>

#include "../sampling/Sampler.h"

Postea's avatar
Postea committed
namespace material {

class Material {
Yoel's avatar
Yoel committed
   public:
	virtual util::Vec3 albedo(float texel_x, float texel_y) const = 0;
	virtual util::Vec3 emission(float texel_x, float texel_y) const = 0;
Yoel's avatar
Yoel committed
	virtual util::Vec3 scattered_d(const util::Vec3& d,
	                               const util::Vec3& n) const = 0;
	virtual bool scatter() const = 0;
};

static std::random_device rd;
static std::mt19937 gen(rd());
static std::uniform_real_distribution<> dis(-1.0, 1.0);
util::Vec3 rand_vec3();
bool in_circle(const util::Vec3& v);
util::Vec3 rand_vec3_in_circle(float r);
Yoel's avatar
Yoel committed
}  // namespace material