Add camera aperture / depth-of-field
This commit is contained in:
5
demo.c
5
demo.c
@@ -13,6 +13,8 @@
|
||||
#define MIN_RAD 1.0
|
||||
|
||||
#define FOV 90
|
||||
#define APERTURE 0.5
|
||||
#define FOCAL_LEN 100.0
|
||||
#define SAMPLES_PER_PIXEL 100
|
||||
|
||||
static const vec3_t camera_pos = { -100.0, 25.0, -100.0 };
|
||||
@@ -62,7 +64,8 @@ int main()
|
||||
rand_obj(objs + i, &rng);
|
||||
|
||||
img_t img = { .pix = pixbuf };
|
||||
camera_t camera = camera_init(camera_pos, target, FOV, W, H, APERTURE);
|
||||
camera_t camera
|
||||
= camera_init(camera_pos, target, FOV, W, H, APERTURE, FOCAL_LEN);
|
||||
|
||||
const scene_t scene = {
|
||||
.sky_colour = sky,
|
||||
|
||||
Reference in New Issue
Block a user