Make samples per pixel a camera parameter
This commit is contained in:
4
demo.c
4
demo.c
@@ -9,6 +9,7 @@
|
||||
#define H 600
|
||||
#define FOCAL_LEN 1.0
|
||||
#define VIEWPORT_H 2.0
|
||||
#define SAMPLES_PER_PIXEL 100
|
||||
|
||||
#define NELEMS(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
@@ -30,7 +31,8 @@ static pix_t pixbuf[W * H];
|
||||
int main()
|
||||
{
|
||||
img_t img = { .pix = pixbuf };
|
||||
camera_t camera = camera_init(camera_pos, FOCAL_LEN, VIEWPORT_H, W, H);
|
||||
camera_t camera = camera_init(
|
||||
camera_pos, FOCAL_LEN, VIEWPORT_H, W, H, SAMPLES_PER_PIXEL);
|
||||
camera_render(&camera, scene, NELEMS(scene), &img);
|
||||
|
||||
ff_write(STDOUT_FILENO, img);
|
||||
|
||||
Reference in New Issue
Block a user