Skip to content
Snippets Groups Projects
BackgroundMaterial.cpp 779 B
Newer Older
Postea's avatar
Postea committed
#include "BackgroundMaterial.h"
Yoel's avatar
Yoel committed

#include "texture/Constant.h"
Postea's avatar
Postea committed

namespace material {
Yoel's avatar
Yoel committed
BackgroundMaterial::BackgroundMaterial(
    const std::shared_ptr<util::Sampler>& texture)
    : texture(texture) {
BackgroundMaterial::BackgroundMaterial(const util::Vec3& albedo)
Yoel's avatar
Yoel committed
    : texture(std::make_shared<Constant>(albedo)) {
Yoel's avatar
Yoel committed
util::Vec3 BackgroundMaterial::albedo(float texel_x, float texel_y) {
	return util::Vec3(1, 1, 1);
Yoel's avatar
Yoel committed
util::Vec3 BackgroundMaterial::emission(float texel_x, float texel_y) {
	return texture->color(texel_x, -texel_y);
Yoel's avatar
Yoel committed
util::Vec3 BackgroundMaterial::scattered_d(const util::Vec3& d,
                                           const util::Vec3& n) {
	return util::Vec3(0, 0, 0);
Yoel's avatar
Yoel committed
bool BackgroundMaterial::scatter() {
	return false;
Yoel's avatar
Yoel committed
}  // namespace material