summaryrefslogtreecommitdiff
path: root/test/raytracer/light.h
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2008-08-09 08:06:33 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2008-08-09 08:06:33 +0000
commit285f5bec5bb03d4e825e5d866e94008088dd6155 (patch)
tree9df69ded9ed4f4049e0b3887fdd99fcdf3b1746f /test/raytracer/light.h
parenta83f0c1710cc5143dd885e84c94e14f7d3216f93 (diff)
Ajout nouveaux tests
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@708 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test/raytracer/light.h')
-rw-r--r--test/raytracer/light.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/test/raytracer/light.h b/test/raytracer/light.h
new file mode 100644
index 0000000..9a1d3e2
--- /dev/null
+++ b/test/raytracer/light.h
@@ -0,0 +1,33 @@
+struct light {
+ enum { Directional, Pointlight, Spot } kind;
+ union {
+ struct {
+ struct point dir;
+ struct point col;
+ } directional;
+ struct {
+ struct point orig;
+ struct point col;
+ } point;
+ struct {
+ struct point orig;
+ struct point at;
+ struct point col;
+ flt cutoff, exponent;
+ struct vector unit;
+ } spot;
+ } u;
+};
+
+struct light * dirlight(struct point * dir, struct point * c);
+struct light * pointlight(struct point * orig, struct point * c);
+struct light * spotlight(struct point * pos, struct point * at,
+ struct point * c, flt a, flt cutoff);
+
+void color_from_lights(struct object * obj,
+ struct point * p,
+ struct vector * v,
+ struct vector * n,
+ flt kd, flt ks, flt phong,
+ struct light ** lights,
+ /*out*/ struct point * il);