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

Refactor to use Random class

parent 1047847a
No related branches found
No related tags found
No related merge requests found
......@@ -9,8 +9,8 @@ Vec3 StratifiedSampler::color(float x, float y) const {
Vec3 color(0, 0, 0);
for (int xi = 0; xi < n; xi++) {
for (int yi = 0; yi < n; yi++) {
float rx = dis(gen);
float ry = dis(gen);
float rx = dis0to1(gen);
float ry = dis0to1(gen);
float xs = x + (xi + rx) / n;
float ys = y + (yi + ry) / n;
color = color + sampler->color(xs, ys);
......
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