Split scene definition to use it in both raytracer and rasteriser

This commit is contained in:
2024-06-22 16:46:55 +01:00
parent fbe4513a14
commit 8fc3a2577a
5 changed files with 117 additions and 98 deletions

41
include/scene/scene.h Normal file
View File

@@ -0,0 +1,41 @@
#ifndef SCENE_H
#define SCENE_H
#include "c_cpp_aliases/aliases.h"
#include "window/window.h"
typedef struct {
f32 radius;
vec3f_t centre;
colour_t colour;
f32 specular;
f32 reflective;
} sphere_t;
typedef enum {
LIGHT_TYPE_POINT,
LIGHT_TYPE_DIRECTIONAL,
LIGHT_TYPE_AMBIENT,
COUNT_LIGHT_TYPE,
} light_type_t;
typedef struct {
light_type_t type;
f32 intensity;
union {
vec3f_t position;
vec3f_t direction;
};
} light_t;
typedef struct {
const sphere_t *spheres;
const light_t *lights;
u32 spheres_count;
u32 lights_count;
} scene_t;
const scene_t *build_test_scene(void);
#endif // !SCENE_H