Create material abstraction

This commit is contained in:
2025-09-23 15:36:08 +01:00
parent b15edd1906
commit ce45c57662
8 changed files with 84 additions and 26 deletions

7
demo.c
View File

@@ -15,9 +15,10 @@
static const vec3_t camera_pos = { 0.0, 0.0, 0.0 };
static const obj_t scene[] = {
SPHERE(1.0, 0.0, -3.0, 1.0),
SPHERE(-2.0, -0.5, -5.0, 1.0),
SPHERE(0.0, -1001.0, 0.0, 1000.0),
SPHERE(1.0, 0.0, -3.0, 1.0, LAMBERTIAN(0.6, 0.2, 0.8)),
SPHERE(-0.8, 0.0, -3.8, 1.0, LAMBERTIAN(1.0, 1.0, 1.0)),
SPHERE(-1.0, -0.8, -2.6, 0.2, LAMBERTIAN(0.9, 0.6, 0.2)),
SPHERE(0.0, -1001.0, 0.0, 1000.0, LAMBERTIAN(0.3, 0.3, 0.3)),
};
static pix_t pixbuf[W * H];