- remove thing color from lighting calculations. - implement alpha textures and inverse sprites for infrared as texture modes. This still requires some handling for the alpha texture mode for non-shader rendering because there is no way in the fixed pipeline to do it. The inverted texture effect can be done with a texture combiner. - fixed: ThingColor for sprites was set in the wrong place. It must be in the Process function, not in the lighting calculation. - added functions for isolated calculation of sprites' dynlight color.
65 lines
No EOL
1.9 KiB
C
65 lines
No EOL
1.9 KiB
C
#ifndef __GL_LIGHTDATA
|
|
#define __GL_LIGHTDATA
|
|
|
|
#include "v_palette.h"
|
|
#include "r_data/renderstyle.h"
|
|
#include "gl/renderer/gl_colormap.h"
|
|
|
|
bool gl_BrightmapsActive();
|
|
bool gl_GlowActive();
|
|
|
|
inline int gl_ClampLight(int lightlevel)
|
|
{
|
|
return clamp(lightlevel, 0, 255);
|
|
}
|
|
|
|
void gl_GetRenderStyle(FRenderStyle style, bool drawopaque, bool allowcolorblending,
|
|
int *tm, int *sb, int *db, int *be);
|
|
void gl_SetFogParams(int _fogdensity, PalEntry _outsidefogcolor, int _outsidefogdensity, int _skyfog);
|
|
|
|
int gl_CalcLightLevel(int lightlevel, int rellight, bool weapon);
|
|
PalEntry gl_CalcLightColor(int light, PalEntry pe, int blendfactor, bool force = false);
|
|
void gl_GetLightColor(int lightlevel, int rellight, const FColormap * cm, float * pred, float * pgreen, float * pblue, bool weapon=false);
|
|
void gl_SetColor(int light, int rellight, const FColormap * cm, float alpha, bool weapon=false);
|
|
|
|
float gl_GetFogDensity(int lightlevel, PalEntry fogcolor);
|
|
struct sector_t;
|
|
bool gl_CheckFog(FColormap *cm, int lightlevel);
|
|
bool gl_CheckFog(sector_t *frontsector, sector_t *backsector);
|
|
|
|
void gl_SetFog(int lightlevel, int rellight, const FColormap *cm, bool isadditive);
|
|
|
|
inline bool gl_isBlack(PalEntry color)
|
|
{
|
|
return color.r + color.g + color.b == 0;
|
|
}
|
|
|
|
inline bool gl_isWhite(PalEntry color)
|
|
{
|
|
return color.r + color.g + color.b == 3*0xff;
|
|
}
|
|
|
|
extern DWORD gl_fixedcolormap;
|
|
|
|
inline bool gl_isFullbright(PalEntry color, int lightlevel)
|
|
{
|
|
return gl_fixedcolormap || (gl_isWhite(color) && lightlevel==255);
|
|
}
|
|
|
|
__forceinline void gl_Desaturate(int gray, int ired, int igreen, int iblue, BYTE & red, BYTE & green, BYTE & blue, int fac)
|
|
{
|
|
red = (ired*(31-fac) + gray*fac)/31;
|
|
green = (igreen*(31-fac) + gray*fac)/31;
|
|
blue = (iblue*(31-fac) + gray*fac)/31;
|
|
}
|
|
|
|
void gl_ModifyColor(BYTE & red, BYTE & green, BYTE & blue, int cm);
|
|
void gl_DeleteAllAttachedLights();
|
|
void gl_RecreateAllAttachedLights();
|
|
|
|
extern int fogdensity;
|
|
extern int outsidefogdensity;
|
|
extern int skyfog;
|
|
|
|
|
|
#endif |