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