#include "r_shadow.h"
cvar_t r_modellights = {CVAR_SAVE, "r_modellights", "4"};
-cvar_t r_vismarklights = {0, "r_vismarklights", "1"};
cvar_t r_coronas = {CVAR_SAVE, "r_coronas", "1"};
cvar_t gl_flashblend = {CVAR_SAVE, "gl_flashblend", "0"};
{
float dx, dy;
int x, y, a;
- qbyte pixels[32][32][4];
+ unsigned char pixels[32][32][4];
lighttexturepool = R_AllocTexturePool();
for (y = 0;y < 32;y++)
{
void R_Light_Init(void)
{
Cvar_RegisterVariable(&r_modellights);
- Cvar_RegisterVariable(&r_vismarklights);
Cvar_RegisterVariable(&r_coronas);
Cvar_RegisterVariable(&gl_flashblend);
R_RegisterModule("R_Light", r_light_start, r_light_shutdown, r_light_newmap);
// silly directional diffuse shading
if (usediffuse)
{
+ // we have to negate this result because it is the incoming light
+ // direction, not simply the normal to dotproduct with.
dot = DotProduct(normal3f, dnormal);
- if (dot > 0)
- VectorMA(color, dot, diffusecolor, color);
+ if (dot < 0)
+ VectorMA(color, -dot, diffusecolor, color);
}
// pretty good lighting