-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathrender.cpp
More file actions
34 lines (25 loc) · 788 Bytes
/
Copy pathrender.cpp
File metadata and controls
34 lines (25 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "settings.h"
#include "utils.h"
#include "camera.h"
#include "render.h"
#include "bsdf.h"
#include "intersections.h"
#include <vector>
void renderPixel(
int sampleNumber,
int x, int y,
int w, int h,
int maxDepth,
Camera& camera,
const std::vector<float3>& positions,
const std::vector<float3>& normals,
const std::vector<Triangle>& mesh,
std::vector<float3>& image, // write your output to this array
const BVH& bvh // Ignore this for now!
) {
int pixelIdx = y * w + x;
// To keep track of all the different light contributions that we have gotten
float3 colors_sum = f3(0.0f, 0.0f, 0.0f);
// ---------------------- Begin your code below --------------------------------
image.at(pixelIdx) += colors_sum;
}