Tachyon (current)
Current Main Branch
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "tachyon.h"
#include "macros.h"
#include "vector.h"
#include "intersect.h"
#include "util.h"
#include "light.h"
Go to the source code of this file.
Macros | |
#define | TACHYON_INTERNAL 1 |
#define | LIGHT_PRIVATE |
Functions | |
void | free_light_special (void *voidlight) |
directional_light * | newdirectionallight (void *tex, vector dir) |
point_light * | newpointlight (void *tex, vector ctr, flt rad) |
point_light * | newspotlight (void *tex, vector ctr, flt rad, vector dir, flt fallstart, flt fallend) |
void | light_set_attenuation (point_light *li, flt Kc, flt Kl, flt Kq) |
static flt | directional_light_shade_diffuse (directional_light *li, shadedata *shadevars) |
static flt | simple_point_light_shade_diffuse (point_light *li, shadedata *shadevars) |
static flt | point_light_shade_diffuse (point_light *li, shadedata *shadevars) |
static flt | light_no_attenuation (void *vli, flt Llen) |
static flt | light_complex_attenuation (void *vli, flt Llen) |
static flt | light_no_falloff (void *vli, vector *L) |
static flt | light_spotlight_falloff (void *vli, vector *L) |
static int | light_bbox (void *obj, vector *min, vector *max) |
static void | light_intersect (const point_light *l, ray *ry) |
static void | light_normal (const point_light *l, const vector *pnt, const ray *incident, vector *N) |
Variables | |
static object_methods | light_methods |
|
static |
Definition at line 148 of file light.c.
References directional_light_t::dir, and VDOT.
Referenced by free_light_special(), and newdirectionallight().
void free_light_special | ( | void * | voidlight | ) |
Definition at line 35 of file light.c.
References directional_light_shade_diffuse(), and light_t::shade_diffuse.
Referenced by rt_deletescene().
|
static |
Definition at line 210 of file light.c.
References point_light_t::Kc, point_light_t::Kl, and point_light_t::Kq.
Referenced by light_set_attenuation().
|
static |
Definition at line 248 of file light.c.
References point_light_t::ctr, point_light_t::rad, SQRT, VDOT, and VSUB.
Definition at line 206 of file light.c.
Referenced by newpointlight(), and newspotlight().
|
static |
Definition at line 219 of file light.c.
Referenced by newpointlight().
|
static |
Definition at line 275 of file light.c.
References point_light_t::ctr, SQRT, and VDot().
void light_set_attenuation | ( | point_light * | li, |
flt | Kc, | ||
flt | Kl, | ||
flt | Kq | ||
) |
Definition at line 129 of file light.c.
References point_light_t::attenuationfunc, point_light_t::Kc, point_light_t::Kl, point_light_t::Kq, light_complex_attenuation(), point_light_shade_diffuse(), and point_light_t::shade_diffuse.
Referenced by rt_light_attenuation().
|
static |
Definition at line 224 of file light.c.
References ACOS, point_light_t::fallend, point_light_t::fallstart, point_light_t::spotdir, and VDOT.
Referenced by newspotlight().
directional_light* newdirectionallight | ( | void * | tex, |
vector | dir | ||
) |
Definition at line 42 of file light.c.
References directional_light_t::dir, directional_light_shade_diffuse(), light_methods, and directional_light_t::shade_diffuse.
Referenced by rt_directional_light().
point_light* newpointlight | ( | void * | tex, |
vector | ctr, | ||
flt | rad | ||
) |
Definition at line 63 of file light.c.
References point_light_t::attenuationfunc, point_light_t::ctr, point_light_t::fallend, point_light_t::fallstart, point_light_t::Kc, point_light_t::Kl, point_light_t::Kq, light_methods, light_no_attenuation(), light_no_falloff(), point_light_t::rad, point_light_t::shade_diffuse, simple_point_light_shade_diffuse(), point_light_t::spotdir, and point_light_t::spotfunc.
Referenced by rt_light().
point_light * newspotlight | ( | void * | tex, |
vector | ctr, | ||
flt | rad, | ||
vector | dir, | ||
flt | fallstart, | ||
flt | fallend | ||
) |
Definition at line 95 of file light.c.
References point_light_t::attenuationfunc, point_light_t::ctr, point_light_t::fallend, point_light_t::fallstart, point_light_t::Kc, point_light_t::Kl, point_light_t::Kq, light_methods, light_no_attenuation(), light_spotlight_falloff(), point_light_shade_diffuse(), point_light_t::rad, point_light_t::shade_diffuse, point_light_t::spotdir, and point_light_t::spotfunc.
Referenced by rt_spotlight().
|
static |
Definition at line 183 of file light.c.
References point_light_t::attenuationfunc, point_light_t::ctr, point_light_t::spotfunc, SQRT, VDOT, and VSUB.
Referenced by light_set_attenuation(), and newspotlight().
|
static |
Definition at line 161 of file light.c.
References point_light_t::ctr, SQRT, VDOT, and VSUB.
Referenced by newpointlight().
|
static |
Definition at line 26 of file light.c.
Referenced by newdirectionallight(), newpointlight(), and newspotlight().