diff options
author | SmileTheory <SmileTheory@gmail.com> | 2016-03-28 22:26:19 -0700 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2016-04-07 11:54:15 +0100 |
commit | 92f4cec8690c90188fed24b0c2b8f0c32d245cbd (patch) | |
tree | 74b23a9da2552044bf05caea71eaf81f42544d91 | |
parent | a5086e9f0324b9538b853ec90144b6db4877530d (diff) |
OpenGL2: Improve cubemap outside error.
-rw-r--r-- | src/renderergl2/tr_main.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/renderergl2/tr_main.c b/src/renderergl2/tr_main.c index f4261033..9751ecb3 100644 --- a/src/renderergl2/tr_main.c +++ b/src/renderergl2/tr_main.c @@ -2932,12 +2932,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]); } } |