Port some lightning fixes from gl3 to vk.

* Fix for skyboxes abused as lightsources, was #393.
* Don't reuse i as counter variable when calculating light points.
This commit is contained in:
Yamagi 2020-12-16 09:19:28 +01:00
parent b7bdd0be72
commit 983f7f6b4b
2 changed files with 7 additions and 2 deletions

View file

@ -270,8 +270,8 @@ static int RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
maps++)
{
for (i=0 ; i<3 ; i++)
scale[i] = r_modulate->value*r_newrefdef.lightstyles[surf->styles[maps]].rgb[i];
for (int j=0 ; j<3 ; j++)
scale[j] = r_modulate->value*r_newrefdef.lightstyles[surf->styles[maps]].rgb[j];
pointcolor[0] += lightmap[0] * scale[0] * (1.0/255);
pointcolor[1] += lightmap[1] * scale[1] * (1.0/255);

View file

@ -580,6 +580,11 @@ static void Mod_LoadFaces (lump_t *l)
Vk_SubdivideSurface(out); // cut up polygon for warps
}
if (out->texinfo->flags & SURF_SKY)
{
out->flags |= SURF_DRAWSKY;
}
// create lightmaps and polygons
if (!(out->texinfo->flags & (SURF_SKY | SURF_TRANS33 | SURF_TRANS66 | SURF_WARP)))
Vk_CreateSurfaceLightmap(out);