33 float r,
g,
b,
intensity, thickness = texheight * 0.25f,
border = thickness + 2.0f, ithickness = 1.0f / thickness, center,
n;
37 float centersamples[17][2];
40 for (
x = 0;
x < 16;
x++)
43 centersamples[
x][1] =
lhrandom(0.2f, 1.00f);
45 centersamples[16][0] = centersamples[0][0];
46 centersamples[16][1] = centersamples[0][1];
51 for (
x = 0;
x < texwidth;
x++)
53 r =
x * 16.0f / texwidth;
56 center = centersamples[
y][0] * (1.0f -
g) + centersamples[
y+1][0] *
g;
57 n = centersamples[
y][1] * (1.0f -
g) + centersamples[
y + 1][1] *
g;
58 for (
y = 0;
y < texheight;
y++)
67 data[(
y * texwidth +
x) * 4 + 2] = (
unsigned char)(
bound(0,
r, 255));
68 data[(
y * texwidth +
x) * 4 + 1] = (
unsigned char)(
bound(0,
g, 255));
69 data[(
y * texwidth +
x) * 4 + 0] = (
unsigned char)(
bound(0,
b, 255));
73 data[(
y * texwidth +
x) * 4 + 3] = (
unsigned char)255;
121 e0 =
Mod_Mesh_IndexForVertex(
mod, surf, start[0] +
offset[0], start[1] +
offset[1], start[2] +
offset[2],
n[0],
n[1],
n[2], t1, 0, 0, 0, c[0], c[1], c[2], c[3]);
122 e1 =
Mod_Mesh_IndexForVertex(
mod, surf, start[0] -
offset[0], start[1] -
offset[1], start[2] -
offset[2],
n[0],
n[1],
n[2], t1, 1, 0, 0, c[0], c[1], c[2], c[3]);
123 e2 =
Mod_Mesh_IndexForVertex(
mod, surf, end[0] -
offset[0], end[1] -
offset[1], end[2] -
offset[2],
n[0],
n[1],
n[2], t2, 1, 0, 0, c[0], c[1], c[2], c[3]);
124 e3 =
Mod_Mesh_IndexForVertex(
mod, surf, end[0] +
offset[0], end[1] +
offset[1], end[2] +
offset[2],
n[0],
n[1],
n[2], t2, 0, 0, 0, c[0], c[1], c[2], c[3]);
170 t2 = t1 + beamrepeatscale *
length;
void CL_Beam_CalculatePositions(const beam_t *b, vec3_t start, vec3_t end)
#define CF_CLIENT
cvar/command that only the client can change/execute
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
float mod(float dividend, float divisor)
void Cvar_SetValueQuick(cvar_t *var, float value)
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
static int(ZEXPORT *qz_inflate)(z_stream *strm
skinframe_t * R_SkinFrame_LoadInternalBGRA(const char *name, int textureflags, const unsigned char *skindata, int width, int height, int comparewidth, int compareheight, int comparecrc, qbool sRGB)
mempool_t * r_main_mempool
void R_SkinFrame_MarkUsed(skinframe_t *skinframe)
GLint GLenum GLsizei GLsizei GLint border
GLenum GLuint GLenum GLsizei length
GLint GLenum GLint GLint y
GLsizeiptr const GLvoid * data
GLuint GLuint GLintptr offset
#define VectorNormalize(v)
#define bound(min, num, max)
#define lhrandom(MIN, MAX)
LadyHavoc: this function never returns exactly MIN or exactly MAX, because of a QuakeC bug in id1 whe...
#define Vector4Set(vec, r, g, b, a)
#define VectorSubtract(a, b, out)
#define CrossProduct(a, b, out)
#define VectorScale(in, scale, out)
#define VectorMAM(scale1, b1, scale2, b2, out)
#define VectorMA(a, scale, b, out)
#define VectorM(scale1, b1, out)
#define MATERIALFLAG_VERTEXCOLOR
#define MATERIALFLAG_BLENDED
#define MATERIALFLAG_ALPHAGEN_VERTEX
#define MATERIALFLAG_WALL
#define MATERIALFLAG_NOSHADOW
#define MATERIALFLAG_NOCULLFACE
qbool Mod_LoadTextureFromQ3Shader(mempool_t *mempool, const char *modelname, texture_t *texture, const char *name, qbool warnmissing, qbool fallback, int defaulttexflags, int defaultmaterialflags)
msurface_t * Mod_Mesh_AddSurface(model_t *mod, texture_t *tex, qbool batchwithprevioussurface)
int Mod_Mesh_IndexForVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a)
void Mod_Mesh_AddTriangle(model_t *mod, msurface_t *surf, int e0, int e1, int e2)
void Mod_LoadCustomMaterial(mempool_t *mempool, texture_t *texture, const char *name, int supercontents, int materialflags, skinframe_t *skinframe)
cvar_t r_lightningbeam_scroll
cvar_t r_lightningbeam_repeatdistance
static void CL_Beams_SetupBuiltinTexture(void)
cvar_t r_lightningbeam_color_red
static void r_lightningbeams_start(void)
cvar_t r_lightningbeam_color_blue
static void r_lightningbeams_shutdown(void)
void R_LightningBeams_Init(void)
static texture_t cl_beams_builtintexture
cvar_t r_lightningbeam_color_green
cvar_t r_lightningbeam_thickness
static void CL_Beam_AddQuad(model_t *mod, msurface_t *surf, const vec3_t start, const vec3_t end, const vec3_t offset, float t1, float t2)
cvar_t r_lightningbeam_qmbtexture
void CL_Beam_AddPolygons(const beam_t *b)
static texture_t cl_beams_externaltexture
static void r_lightningbeams_newmap(void)
static void CL_Beams_SetupExternalTexture(void)
void R_RegisterModule(const char *name, void(*start)(void), void(*shutdown)(void), void(*newmap)(void), void(*devicelost)(void), void(*devicerestored)(void))
describes the textures to use on a range of triangles in the model, and mins/maxs (AABB) for culling.
double time
(client gameworld) time for rendering time based effects
struct skinframe_s * currentskinframe
#define Mem_Alloc(pool, size)