summaryrefslogtreecommitdiff
path: root/modules/ray/ray_light_emitter.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@gnugeneration.com>2016-12-13 07:57:56 -0800
committerVito Caputo <vcaputo@gnugeneration.com>2016-12-13 08:01:22 -0800
commit8340e615d46615894b44b4ffce5dc2dd86cbad40 (patch)
treeca9f82767d360f03e09425f21e35d0188eb52d1c /modules/ray/ray_light_emitter.h
parent8add1663d9a02db2bc65224cdceb480733a81379 (diff)
ray: introduce a rudimentary ray tracer
My first ray tracer, it only has spheres, planes, and point light sources. No texture mapping, no soft shadows, no global illumination. This is all very basic right now, the camera movement is simple and boring, but sufficient for further development and optimization. I made some effort to support multiple CPUs, it should detect the number of CPUs in the system and use enough pthreads to keep them busy. Jacco Bikker's tutorial on flipcode was the original impetus to do this, and definitely served as a guide early on.
Diffstat (limited to 'modules/ray/ray_light_emitter.h')
-rw-r--r--modules/ray/ray_light_emitter.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/ray/ray_light_emitter.h b/modules/ray/ray_light_emitter.h
new file mode 100644
index 0000000..3b5509e
--- /dev/null
+++ b/modules/ray/ray_light_emitter.h
@@ -0,0 +1,18 @@
+#ifndef _RAY_LIGHT_EMITTER_H
+#define _RAY_LIGHT_EMITTER_H
+
+#include "ray_object_point.h"
+#include "ray_object_sphere.h"
+
+typedef enum ray_light_emitter_type_t {
+ RAY_LIGHT_EMITTER_TYPE_SPHERE,
+ RAY_LIGHT_EMITTER_TYPE_POINT,
+} ray_light_emitter_type_t;
+
+typedef union ray_light_emitter_t {
+ ray_light_emitter_type_t type;
+ ray_object_sphere_t sphere;
+ ray_object_point_t point;
+} ray_light_emitter_t;
+
+#endif
© All Rights Reserved