aboutsummaryrefslogtreecommitdiff
path: root/scene.h
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2020-03-09 15:44:21 +0100
committerJulian T <julian@jtle.dk>2020-03-09 15:44:21 +0100
commit0262431a3c78738a0bf44d6f4e54b0942651f59e (patch)
tree1e785d556ea6beef2633dcc554f628a975a72ec9 /scene.h
parent0b61f67456ec43f8553b199c4f524436ef467259 (diff)
Added redundant lambert stufflambert
Diffstat (limited to 'scene.h')
-rw-r--r--scene.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/scene.h b/scene.h
index 90e5ebb..c2893ca 100644
--- a/scene.h
+++ b/scene.h
@@ -11,6 +11,10 @@
#define TYPE_SPHERE 1
#define TYPE_PLANE 2
+#define LIGHT_LAMBERT 0
+#define LIGHT_PHONG 1
+#define LIGHT_NONE 2
+
typedef struct {
vector_t *center;
COORD_T radius;
@@ -33,9 +37,14 @@ typedef struct {
vector_t color;
// Light properties
- COORD_T defuse;
- COORD_T specular;
- unsigned int shine;
+ unsigned int light_type;
+ union {
+ struct phong_s {
+ COORD_T defuse;
+ COORD_T specular;
+ unsigned int shine;
+ } phong;
+ };
// Reflective properties
COORD_T reflective;
@@ -68,6 +77,8 @@ object_t *add_sphere(space_t *s, vector_t *c, COORD_T r, material_t *m);
object_t *add_plane(space_t *s, vector_t *start, vector_t *dir, material_t *m);
light_t *add_light(space_t *s, vector_t *pos, color_t *defuse, color_t *specular);
+void material_set_phong(material_t *m, COORD_T defuse, COORD_T specular, unsigned int shine);
+
void obj_norm_at(object_t *o, vector_t *dest, vector_t *point);
#endif