Skip to content
Snippets Groups Projects
Commit ba85bea4 authored by Yoel's avatar Yoel
Browse files

Checkerboard was wrongfully added to the counting branch, so we copied it over

parent 8203eaec
No related branches found
No related tags found
No related merge requests found
#include "Checkerboard.h"
namespace material {
Checkerboard::Checkerboard(int size) : size(size) {
}
util::Vec3 Checkerboard::color(float x, float y) const {
util::Vec3 color(0);
bool hori = (int)(x * size) % 2 == 0;
bool verti = (int)(y * size) % 2 == 0;
if (hori ^ verti) color = util::Vec3(1);
return color;
}
} // namespace material
\ No newline at end of file
#pragma once
#include "../../sampling/Sampler.h"
namespace material {
class Checkerboard : public util::Sampler {
public:
Checkerboard(int size);
util::Vec3 color(float x, float y) const override;
private:
float size;
};
} // namespace material
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment