Skip to content

Commit

Permalink
OpenGL2: Improve cubemap outside error.
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileTheory committed Mar 29, 2016
1 parent 11668bb commit ee7fdef
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code/renderergl2/tr_main.c
Expand Up @@ -2931,12 +2931,16 @@ void R_RenderCubemapSide( int cubemapIndex, int cubemapSide, qboolean subscene )

{
vec3_t ambient, directed, lightDir;
float scale;

R_LightForPoint(tr.refdef.vieworg, ambient, directed, lightDir);
tr.refdef.colorScale = 1.0f; //766.0f / (directed[0] + directed[1] + directed[2] + 1.0f);
scale = directed[0] + directed[1] + directed[2] + ambient[0] + ambient[1] + ambient[2] + 1.0f;

tr.refdef.colorScale = 1.0f; //766.0f / scale;
// only print message for first side
if (directed[0] + directed[1] + directed[2] == 0 && cubemapSide == 0)
if (scale < 1.0001f && cubemapSide == 0)
{
ri.Printf(PRINT_ALL, "cubemap %d %s (%f, %f, %f) is outside the lightgrid!\n", cubemapIndex, tr.cubemaps[cubemapIndex].name, tr.refdef.vieworg[0], tr.refdef.vieworg[1], tr.refdef.vieworg[2]);
ri.Printf(PRINT_ALL, "cubemap %d %s (%f, %f, %f) is outside the lightgrid or inside a wall!\n", cubemapIndex, tr.cubemaps[cubemapIndex].name, tr.refdef.vieworg[0], tr.refdef.vieworg[1], tr.refdef.vieworg[2]);
}
}

Expand Down

0 comments on commit ee7fdef

Please sign in to comment.