Allow negative sky colour to be specified

This commit is contained in:
2025-09-23 15:36:09 +01:00
parent e6ee20d5d1
commit cf876f4a8b
4 changed files with 11 additions and 6 deletions

6
demo.c
View File

@@ -16,7 +16,8 @@
static const vec3_t camera_pos = { 80.0, 30.0, 60.0 };
static const vec3_t target = { 0.0, 0.0, 10.0 };
static const vec3_t sky = { 0.6, 0.8, 1.0 };
static const vec3_t sky_pos = { 0.6, 0.8, 1.0 };
static const vec3_t sky_neg = { 1.0, 1.0, 1.0 };
static const material_t floor = LAMBERTIAN(1.0, 0.94, 0.80);
static const material_t light = AREA_LIGHT(1.0, 0.8, 0.5, 4.0);
@@ -43,7 +44,8 @@ int main()
= camera_init(camera_pos, target, FOV, W, H, APERTURE, FOCAL_LEN);
const scene_t scene = {
.sky_colour = sky,
.sky_pos = sky_pos,
.sky_neg = sky_neg,
.objs = objs,
.obj_count = NELEMS(objs),
};