mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 07:12:07 +00:00
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:
parent
b7bdd0be72
commit
983f7f6b4b
2 changed files with 7 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue