UFO: Alien Invasion
Loading...
Searching...
No Matches
r_light.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 1997-2001 Id Software, Inc.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
27struct entity_s;
28
29typedef struct light_s {
32 float radius;
33} light_t;
34
36typedef struct sustain_s {
38 float time;
39 float sustain;
40} sustain_t;
41
42/* cap on number of light sources that can be in a scene; feel free
43 * to increase if necessary, but be aware that doing so will increase
44 * the time it takes for each entity to sort the light list at each
45 * frame (this is based on the number of lights actually used, not
46 * the max number allowed) */
47#define MAX_STATIC_LIGHTS 1024
48
50void R_AddLight(const vec3_t origin, float radius, const vec3_t color);
51void R_AddSustainedLight(const vec3_t org, float radius, const vec3_t color, float sustain);
53void R_EnableWorldLights(void);
54void R_EnableModelLights(const light_t** lights, int numLights, bool inShadow, bool enable);
55void R_DisableLights(void);
56
57void R_AddStaticLight(const vec3_t origin, float radius, const vec3_t color);
58void R_ClearStaticLights(void);
59void R_UpdateLightList(struct entity_s* ent);
voidpf uLong int origin
Definition ioapi.h:45
static light_t * lights[LIGHTMAP_MAX]
Definition lightmap.cpp:285
void R_AddSustainedLight(const vec3_t org, float radius, const vec3_t color, float sustain)
Definition r_light.cpp:58
void R_AddStaticLight(const vec3_t origin, float radius, const vec3_t color)
Add static light for model lighting (world already got them baked into lightmap).
Definition r_light.cpp:261
void R_ClearStaticLights(void)
Remove all static light data.
Definition r_light.cpp:300
void R_EnableModelLights(const light_t **lights, int numLights, bool inShadow, bool enable)
Enable or disable realtime dynamic lighting for models.
Definition r_light.cpp:149
void R_UpdateSustainedLights(void)
Updates state of sustained lights; should be called once per frame right before world rendering.
Definition r_light.cpp:83
void R_AddLight(const vec3_t origin, float radius, const vec3_t color)
Create light to be rendered in the current frame (will be removed before the next).
Definition r_light.cpp:36
void R_UpdateLightList(struct entity_s *ent)
void R_DisableLights(void)
Definition r_light.cpp:282
void R_EnableWorldLights(void)
Set up lighting data for the GLSL world shader.
Definition r_light.cpp:108
a light source
Definition r_light.h:29
vec4_t color
Definition r_light.h:31
vec3_t origin
Definition r_light.h:30
float radius
Definition r_light.h:32
sustains are light flashes which slowly decay
Definition r_light.h:36
float sustain
Definition r_light.h:39
light_t light
Definition r_light.h:37
float time
Definition r_light.h:38
vec_t vec3_t[3]
Definition ufotypes.h:39
vec_t vec4_t[4]
Definition ufotypes.h:40