if (!CHECKPVSBIT(outsurfacepvs, surfaceindex))
{
surface = model->brushq1.surfaces + surfaceindex;
- if (BoxesOverlap(lightmins, lightmaxs, surface->poly_mins, surface->poly_maxs))
+ if (BoxesOverlap(lightmins, lightmaxs, surface->poly_mins, surface->poly_maxs) && (surface->flags & SURF_LIGHTMAP) && !surface->texinfo->texture->skin.fog)
{
for (triangleindex = 0, t = surface->num_firstshadowmeshtriangle, e = model->brush.shadowmesh->element3i + t * 3;triangleindex < surface->mesh.num_triangles;triangleindex++, t++, e += 3)
{
lightmaxs[2] = relativelightorigin[2] + lightradius;
R_Mesh_Matrix(&ent->matrix);
Matrix4x4_Transform(&ent->inversematrix, r_vieworigin, modelorg);
+ R_UpdateTextureInfo(ent);
for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++)
{
surface = model->brushq1.surfaces + surfacelist[surfacelistindex];
{
if (!face->num_triangles)
return;
- if (face->texture->surfaceparms)
- {
- if (face->texture->surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NODRAW))
- return;
- }
+ if (face->texture->surfaceflags && (face->texture->surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NODRAW)))
+ return;
c_faces++;
if ((face->texture->surfaceparms & Q3SURFACEPARM_TRANS) || ent->alpha < 1 || (ent->effects & EF_ADDITIVE))
{
surfaceindex = surface - model->brushq3.data_faces;
if (!CHECKPVSBIT(outsurfacepvs, surfaceindex))
{
- if (BoxesOverlap(lightmins, lightmaxs, surface->mins, surface->maxs))
+ if (BoxesOverlap(lightmins, lightmaxs, surface->mins, surface->maxs) && !(surface->texture->surfaceparms & Q3SURFACEPARM_TRANS) && !(surface->texture->surfaceflags & (Q3SURFACEFLAG_SKY | Q3SURFACEFLAG_NODRAW)))
{
for (triangleindex = 0, t = surface->num_firstshadowmeshtriangle, e = model->brush.shadowmesh->element3i + t * 3;triangleindex < surface->num_triangles;triangleindex++, t++, e += 3)
{