static qbyte templight[MAX_LIGHTMAP_SIZE*MAX_LIGHTMAP_SIZE*4];
cvar_t r_ambient = {0, "r_ambient", "0"};
-cvar_t r_dlightmap = {CVAR_SAVE, "r_dlightmap", "1"};
cvar_t r_drawportals = {0, "r_drawportals", "0"};
cvar_t r_testvis = {0, "r_testvis", "0"};
cvar_t r_floatbuildlightmap = {0, "r_floatbuildlightmap", "0"};
else
memset(bl, 0, size*3*sizeof(unsigned int));
- if (surf->dlightframe == r_framecount && r_dlightmap.integer)
+ if (surf->dlightframe == r_framecount)
{
surf->cached_dlight = R_IntAddDynamicLights(&ent->inversematrix, surf);
if (surf->cached_dlight)
else
memset(bl, 0, size*3*sizeof(float));
- if (surf->dlightframe == r_framecount && r_dlightmap.integer)
+ if (surf->dlightframe == r_framecount)
{
surf->cached_dlight = R_FloatAddDynamicLights(&ent->inversematrix, surf);
if (surf->cached_dlight)
}
}
-static void RSurfShader_OpaqueWall_Pass_Light(const entity_render_t *ent, const texture_t *texture, msurface_t **surfchain)
-{
- const msurface_t *surf;
- const surfmesh_t *mesh;
- float colorscale;
- rmeshstate_t m;
-
- memset(&m, 0, sizeof(m));
- GL_BlendFunc(GL_SRC_ALPHA, GL_ONE);
- GL_DepthMask(false);
- GL_DepthTest(true);
- m.tex[0] = R_GetTexture(texture->skin.base);
- colorscale = 1;
- if (gl_combine.integer)
- {
- m.texrgbscale[0] = 4;
- colorscale *= 0.25f;
- }
- GL_ColorPointer(varray_color4f);
- while((surf = *surfchain++) != NULL)
- {
- if (surf->visframe == r_framecount && surf->dlightframe == r_framecount)
- {
- for (mesh = surf->mesh;mesh;mesh = mesh->chain)
- {
- if (RSurf_LightCheck(&ent->inversematrix, surf->dlightbits, mesh))
- {
- GL_VertexPointer(mesh->vertex3f);
- m.pointer_texcoord[0] = mesh->texcoordtexture2f;
- R_FillColors(varray_color4f, mesh->numverts, 0, 0, 0, 1);
- R_Mesh_State_Texture(&m);
- RSurf_LightSeparate_Vertex3f_Color4f(&ent->inversematrix, surf->dlightbits, mesh->numverts, mesh->vertex3f, varray_color4f, colorscale);
- R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
- }
- }
- }
- }
-}
-
static void RSurfShader_OpaqueWall_Pass_Fog(const entity_render_t *ent, const texture_t *texture, msurface_t **surfchain)
{
const msurface_t *surf;
if (r_detailtextures.integer)
RSurfShader_OpaqueWall_Pass_BaseDetail(ent, texture, surfchain);
}
- if (!r_dlightmap.integer && !(ent->effects & EF_FULLBRIGHT))
- RSurfShader_OpaqueWall_Pass_Light(ent, texture, surfchain);
if (texture->skin.glow)
RSurfShader_OpaqueWall_Pass_Glow(ent, texture, surfchain);
if (fogenabled)
dlightdivtable[i] = 4194304 / (i << 7);
Cvar_RegisterVariable(&r_ambient);
- Cvar_RegisterVariable(&r_dlightmap);
Cvar_RegisterVariable(&r_drawportals);
Cvar_RegisterVariable(&r_testvis);
Cvar_RegisterVariable(&r_floatbuildlightmap);
}
}
-#define OPTIONS_EFFECTS_ITEMS 21
+#define OPTIONS_EFFECTS_ITEMS 20
int options_effects_cursor;
extern cvar_t cl_stainmaps;
extern cvar_t cl_decals;
extern cvar_t r_explosionclip;
-extern cvar_t r_dlightmap;
extern cvar_t r_modellights;
extern cvar_t r_coronas;
extern cvar_t gl_flashblend;
optnum = 0;
if (options_effects_cursor == optnum++)
Cvar_SetValueQuick (&r_modellights, bound(0, r_modellights.value + dir, 8));
- else if (options_effects_cursor == optnum++)
- Cvar_SetValueQuick (&r_dlightmap, !r_dlightmap.integer);
else if (options_effects_cursor == optnum++)
Cvar_SetValueQuick (&r_coronas, !r_coronas.integer);
else if (options_effects_cursor == optnum++)
opty = 32 - bound(0, optcursor - (visible >> 1), max(0, OPTIONS_EFFECTS_ITEMS - visible)) * 8;
M_Options_PrintSlider( " Lights Per Model", true, r_modellights.value, 0, 8);
- M_Options_PrintCheckbox(" Fast Dynamic Lighting", true, !r_dlightmap.integer);
M_Options_PrintCheckbox(" Coronas", true, r_coronas.integer);
M_Options_PrintCheckbox(" Use Only Coronas", true, gl_flashblend.integer);
M_Options_PrintCheckbox(" Particles", true, cl_particles.integer);