mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-14 00:41:03 +00:00
gl1,gl3: sync model light calculation
This commit is contained in:
parent
b4fb6db4fc
commit
138fce15ea
2 changed files with 19 additions and 11 deletions
|
@ -303,17 +303,20 @@ R_RecursiveLightPoint(mnode_t *node, vec3_t start, vec3_t end)
|
||||||
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
|
for (maps = 0; maps < MAXLIGHTMAPS && surf->styles[maps] != 255;
|
||||||
maps++)
|
maps++)
|
||||||
{
|
{
|
||||||
|
const float *rgb;
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
|
rgb = r_newrefdef.lightstyles[surf->styles[maps]].rgb;
|
||||||
|
|
||||||
|
/* Apply light level to models */
|
||||||
for (j = 0; j < 3; j++)
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
scale[j] = r_modulate->value *
|
float scale;
|
||||||
r_newrefdef.lightstyles[surf->styles[maps]].rgb[j];
|
|
||||||
|
scale = rgb[j] * r_modulate->value;
|
||||||
|
pointcolor[j] += lightmap[j] * scale * (1.0 / 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
pointcolor[0] += lightmap[0] * scale[0] * (1.0 / 255);
|
|
||||||
pointcolor[1] += lightmap[1] * scale[1] * (1.0 / 255);
|
|
||||||
pointcolor[2] += lightmap[2] * scale[2] * (1.0 / 255);
|
|
||||||
lightmap += 3 * ((surf->extents[0] >> 4) + 1) *
|
lightmap += 3 * ((surf->extents[0] >> 4) + 1) *
|
||||||
((surf->extents[1] >> 4) + 1);
|
((surf->extents[1] >> 4) + 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -231,15 +231,20 @@ RecursiveLightPoint(mnode_t *node, vec3_t start, vec3_t end)
|
||||||
for (maps = 0; maps < MAX_LIGHTMAPS_PER_SURFACE && surf->styles[maps] != 255;
|
for (maps = 0; maps < MAX_LIGHTMAPS_PER_SURFACE && surf->styles[maps] != 255;
|
||||||
maps++)
|
maps++)
|
||||||
{
|
{
|
||||||
for (int j = 0; j < 3; j++)
|
const float *rgb;
|
||||||
|
int j;
|
||||||
|
|
||||||
|
rgb = gl3_newrefdef.lightstyles[surf->styles[maps]].rgb;
|
||||||
|
|
||||||
|
/* Apply light level to models */
|
||||||
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
scale[j] = r_modulate->value *
|
float scale;
|
||||||
gl3_newrefdef.lightstyles[surf->styles[maps]].rgb[j];
|
|
||||||
|
scale = rgb[j] * r_modulate->value;
|
||||||
|
pointcolor[j] += lightmap[j] * scale * (1.0 / 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
pointcolor[0] += lightmap[0] * scale[0] * (1.0 / 255);
|
|
||||||
pointcolor[1] += lightmap[1] * scale[1] * (1.0 / 255);
|
|
||||||
pointcolor[2] += lightmap[2] * scale[2] * (1.0 / 255);
|
|
||||||
lightmap += 3 * ((surf->extents[0] >> 4) + 1) *
|
lightmap += 3 * ((surf->extents[0] >> 4) + 1) *
|
||||||
((surf->extents[1] >> 4) + 1);
|
((surf->extents[1] >> 4) + 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue