cvar_t r_bloom_resolution = {CVAR_SAVE, "r_bloom_resolution", "320"};
cvar_t r_bloom_power = {CVAR_SAVE, "r_bloom_power", "4"};
-cvar_t developer_texturelogging = {0, "developer_texturelogging", "1"};
+cvar_t developer_texturelogging = {0, "developer_texturelogging", "0"};
cvar_t gl_lightmaps = {0, "gl_lightmaps", "0"};
if (cl.worldmodel)
{
strlcpy(entname, cl.worldmodel->name, sizeof(entname));
- l = strlen(entname) - 4;
+ l = (int)strlen(entname) - 4;
if (l >= 0 && !strcmp(entname + l, ".bsp"))
{
strcpy(entname + l, ".ent");
{
gl_backend_init();
R_Textures_Init();
- Mod_RenderInit();
R_MeshQueue_Init();
GL_Main_Init();
GL_Draw_Init();
UI_Init();
Sbar_Init();
R_LightningBeams_Init();
+ Mod_RenderInit();
}
/*
VID_CheckExtensions();
// LordHavoc: report supported extensions
- Con_DPrintf("\nengine extensions: %s\n", ENGINE_EXTENSIONS);
+ Con_DPrintf("\nengine extensions: %s\n", vm_sv_extensions );
// clear to black (loading plaque will be seen over this)
qglClearColor(0,0,0,1);
void R_UpdateTextureInfo(const entity_render_t *ent, texture_t *t)
{
+ texture_t *texture = t;
model_t *model = ent->model;
int s = ent->skinnum;
if ((unsigned int)s >= (unsigned int)model->numskins)
s = model->skinscenes[s].firstframe;
}
if (s > 0)
- t = t->currentframe = t + s * model->num_surfaces;
+ t = t + s * model->num_surfaces;
if (t->animated)
- t = t->currentframe = t->anim_frames[ent->frame != 0][(t->anim_total[ent->frame != 0] >= 2) ? ((int)(r_refdef.time * 5.0f) % t->anim_total[ent->frame != 0]) : 0];
+ t = t->anim_frames[ent->frame != 0][(t->anim_total[ent->frame != 0] >= 2) ? ((int)(r_refdef.time * 5.0f) % t->anim_total[ent->frame != 0]) : 0];
+ texture->currentframe = t;
t->currentmaterialflags = t->basematerialflags;
t->currentalpha = ent->alpha;
if (t->basematerialflags & MATERIALFLAG_WATERALPHA)
t->currentmaterialflags |= MATERIALFLAG_ADD | MATERIALFLAG_TRANSPARENT;
else if (t->currentalpha < 1)
t->currentmaterialflags |= MATERIALFLAG_ALPHA | MATERIALFLAG_TRANSPARENT;
+ if (ent->effects & EF_NODEPTHTEST)
+ t->currentmaterialflags |= MATERIALFLAG_NODEPTHTEST;
}
void R_UpdateAllTextureInfo(entity_render_t *ent)
float *c;
float diff[3];
float colorpants[3], colorshirt[3];
- float f, r, g, b, a, base, colorscale;
+ float f, r, g, b, a, colorscale;
const msurface_t *surface;
qboolean dolightmap;
qboolean doambient;
qboolean lightmodel = false;
rtexture_t *basetexture;
rmeshstate_t m;
- texture = texture->currentframe;
if (texture->currentmaterialflags & MATERIALFLAG_NODRAW)
return;
c_faces += texturenumsurfaces;
dofullbrightshirt = false;
dofullbrightpants = false;
}
- if (dolightmap && gl_combine.integer)
+ if (dolightmap && r_textureunits.integer >= 2 && gl_combine.integer)
{
memset(&m, 0, sizeof(m));
m.tex[1] = R_GetTexture(basetexture);
m.texrgbscale[1] = 2;
m.pointer_color = varray_color4f;
R_Mesh_State(&m);
- colorscale = 1;
+ // transparent is not affected by r_lightmapintensity
+ if (!(texture->currentmaterialflags & MATERIALFLAG_TRANSPARENT))
+ colorscale = r_lightmapintensity;
+ else
+ colorscale = 1;
r = ent->colormod[0] * colorscale;
g = ent->colormod[1] * colorscale;
b = ent->colormod[2] * colorscale;
a = texture->currentalpha;
- base = r_ambient.value * (1.0f / 64.0f);
// q3bsp has no lightmap updates, so the lightstylevalue that
// would normally be baked into the lightmaptexture must be
// applied to the color
GL_LockArrays(0, 0);
}
}
- else if (dolightmap && !(texture->currentmaterialflags & MATERIALFLAG_TRANSPARENT))
+ else if (dolightmap && !(texture->currentmaterialflags & MATERIALFLAG_TRANSPARENT) && !lightmodel)
{
// single texture
GL_BlendFunc(GL_ONE, GL_ZERO);
R_Mesh_TexBind(0, R_GetTexture(surface->lightmaptexture));
R_Mesh_ColorPointer(NULL);
}
- else //if (r == 1 && g == 1 && b == 1)
+ else
{
R_Mesh_TexBind(0, R_GetTexture(r_texture_white));
R_Mesh_ColorPointer(surface->groupmesh->data_lightmapcolor4f);
if (waterscrolling)
m.texmatrix[0] = r_waterscrollmatrix;
m.pointer_color = varray_color4f;
- colorscale = 1;
+ colorscale = 2;
if (gl_combine.integer)
{
- m.texrgbscale[0] = 4;
- colorscale *= 0.25f;
+ m.texrgbscale[0] = 2;
+ colorscale = 1;
}
+ // transparent is not affected by r_lightmapintensity
+ if (!(texture->currentmaterialflags & MATERIALFLAG_TRANSPARENT))
+ colorscale *= r_lightmapintensity;
R_Mesh_State(&m);
r = ent->colormod[0] * colorscale;
g = ent->colormod[1] * colorscale;
colorscale = 1;
if (gl_combine.integer)
{
- m.texrgbscale[0] = 4;
- colorscale *= 0.25f;
+ m.texrgbscale[0] = 2;
+ colorscale *= 0.5f;
}
+ // transparent is not affected by r_lightmapintensity
+ if (!(texture->currentmaterialflags & MATERIALFLAG_TRANSPARENT))
+ colorscale *= r_lightmapintensity;
R_Mesh_State(&m);
r = ent->colormod[0] * colorpants[0] * colorscale;
g = ent->colormod[1] * colorpants[1] * colorscale;
colorscale = 1;
if (gl_combine.integer)
{
- m.texrgbscale[0] = 4;
- colorscale *= 0.25f;
+ m.texrgbscale[0] = 2;
+ colorscale *= 0.5f;
}
+ // transparent is not affected by r_lightmapintensity
+ if (!(texture->currentmaterialflags & MATERIALFLAG_TRANSPARENT))
+ colorscale *= r_lightmapintensity;
R_Mesh_State(&m);
r = ent->colormod[0] * colorshirt[0] * colorscale;
g = ent->colormod[1] * colorshirt[1] * colorscale;
colorscale = 1;
if (gl_combine.integer)
{
- m.texrgbscale[0] = 4;
- colorscale *= 0.25f;
+ m.texrgbscale[0] = 2;
+ colorscale *= 0.5f;
}
R_Mesh_State(&m);
- base = r_ambient.value * (1.0f / 64.0f);
- r = ent->colormod[0] * colorscale * base;
- g = ent->colormod[1] * colorscale * base;
- b = ent->colormod[2] * colorscale * base;
+ colorscale *= r_ambient.value * (1.0f / 64.0f);
+ r = ent->colormod[0] * colorscale;
+ g = ent->colormod[1] * colorscale;
+ b = ent->colormod[2] * colorscale;
a = texture->currentalpha;
applycolor = r != 1 || g != 1 || b != 1 || a != 1;
for (texturesurfaceindex = 0;texturesurfaceindex < texturenumsurfaces;texturesurfaceindex++)
tempcenter[1] = (surface->mins[1] + surface->maxs[1]) * 0.5f;
tempcenter[2] = (surface->mins[2] + surface->maxs[2]) * 0.5f;
Matrix4x4_Transform(&ent->matrix, tempcenter, center);
- R_MeshQueue_AddTransparent(ent->effects & EF_NODEPTHTEST ? r_vieworigin : center, RSurfShader_Transparent_Callback, ent, surface - ent->model->data_surfaces);
+ R_MeshQueue_AddTransparent(texture->currentmaterialflags & MATERIALFLAG_NODEPTHTEST ? r_vieworigin : center, RSurfShader_Transparent_Callback, ent, surface - ent->model->data_surfaces);
}
}
}
numsurfacelist = 0;
}
t = surface->texture;
- f = t->currentmaterialflags & flagsmask;
texture = t->currentframe;
+ f = texture->currentmaterialflags & flagsmask;
}
if (f && surface->num_triangles)
{
numsurfacelist = 0;
}
t = surface->texture;
- f = t->currentmaterialflags & flagsmask;
texture = t->currentframe;
+ f = texture->currentmaterialflags & flagsmask;
}
if (f && surface->num_triangles)
{