/
rend_halo.h
71 lines (61 loc) · 2.79 KB
/
rend_halo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/** @file rend_halo.h Halos and Lens Flares.
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2006-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
*/
#ifndef DENG_CLIENT_RENDER_HALO_H
#define DENG_CLIENT_RENDER_HALO_H
#include <de/Vector>
#include "TextureVariantSpec"
DENG_EXTERN_C int haloOccludeSpeed;
DENG_EXTERN_C int haloMode, haloRealistic, haloBright, haloSize;
DENG_EXTERN_C float haloFadeMax, haloFadeMin, minHaloSize;
void H_Register();
/**
* Returns the texture variant specification for halos.
*/
texturevariantspecification_t &Rend_HaloTextureSpec();
void H_SetupState(bool dosetup);
/**
* Render a halo.
*
* The caller must check that @c sourcevis, really has a ->light! (? -jk)
*
* @param origin Origin of the halo in map space.
* @param size The precalculated radius of the primary halo.
* @param tex Texture to use for the halo.
* @param color Color for the halo.
* @param distanceToViewer Distance to viewer. Used for fading the halo when far away.
* @param occlusionFactor How much the halo is occluded by something.
* @param brightnessFactor Overall brightness factor.
* @param viewXOffset Horizontal offset for the halo (in viewspace, relative to @a x, @a y, @a z).
* @param primary Type of halo:
* - @c true: the primary halo.
* - @c false: the secondary halo. Won't be clipped or occluded
* by anything; they're drawn after everything else,
* during a separate pass. The caller must setup the rendering state.
* @param viewRelativeRotate @c true: Halo rotates in relation to its viewspace origin.
*
* @return @c true, iff a halo was rendered.
*/
bool H_RenderHalo(de::Vector3d const &origin, float size,
DGLuint tex, de::Vector3f const &color,
coord_t distanceToViewer, float occlusionFactor,
float brightnessFactor, float viewXOffset,
bool primary, bool viewRelativeRotate);
// Console commands.
D_CMD(FlareConfig);
#endif // DENG_CLIENT_RENDER_HALO_H