[iortcw] 43/152: All: Rend2: Improve cubemap outside error
Simon McVittie
smcv at debian.org
Fri Sep 8 10:39:56 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.5a
in repository iortcw.
commit fe0fde82fde5d0b975e8dc2e690ce8caaa93d8f5
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Mon Apr 4 03:57:06 2016 -0400
All: Rend2: Improve cubemap outside error
---
MP/code/rend2/tr_main.c | 10 +++++++---
SP/code/rend2/tr_main.c | 10 +++++++---
2 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/MP/code/rend2/tr_main.c b/MP/code/rend2/tr_main.c
index a107443..941b119 100644
--- a/MP/code/rend2/tr_main.c
+++ b/MP/code/rend2/tr_main.c
@@ -3211,12 +3211,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]);
}
}
diff --git a/SP/code/rend2/tr_main.c b/SP/code/rend2/tr_main.c
index 86df639..7cc2b2a 100644
--- a/SP/code/rend2/tr_main.c
+++ b/SP/code/rend2/tr_main.c
@@ -3259,12 +3259,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]);
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list