summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_shade.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2015-12-09 02:00:40 -0800
committerTim Angus <tim@ngus.net>2016-04-07 11:13:30 +0100
commit6f6ca6d529e1739565dbc64891fa7f1b478b8460 (patch)
treebd4ecf7ef9bd049bcb4979d3cbbcef6ea425144c /src/renderergl2/tr_shade.c
parente3ac1437c4e4df764cc3279324fab7e3ee032e2a (diff)
OpenGL2: Parse radius entries from misc_cubemap entities.
Diffstat (limited to 'src/renderergl2/tr_shade.c')
-rw-r--r--src/renderergl2/tr_shade.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/renderergl2/tr_shade.c b/src/renderergl2/tr_shade.c
index f0a6d34b..04b62517 100644
--- a/src/renderergl2/tr_shade.c
+++ b/src/renderergl2/tr_shade.c
@@ -1376,15 +1376,14 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input )
if (!(tr.viewParms.flags & VPF_NOCUBEMAPS) && input->cubemapIndex && r_cubeMapping->integer)
{
vec4_t vec;
+ cubemap_t *cubemap = &tr.cubemaps[input->cubemapIndex - 1];
- GL_BindToTMU( tr.cubemaps[input->cubemapIndex - 1], TB_CUBEMAP);
+ GL_BindToTMU( cubemap->image, TB_CUBEMAP);
- vec[0] = tr.cubemapOrigins[input->cubemapIndex - 1][0] - backEnd.viewParms.or.origin[0];
- vec[1] = tr.cubemapOrigins[input->cubemapIndex - 1][1] - backEnd.viewParms.or.origin[1];
- vec[2] = tr.cubemapOrigins[input->cubemapIndex - 1][2] - backEnd.viewParms.or.origin[2];
+ VectorSubtract(cubemap->origin, backEnd.viewParms.or.origin, vec);
vec[3] = 1.0f;
- VectorScale4(vec, 1.0f / 1000.0f, vec);
+ VectorScale4(vec, 1.0f / cubemap->parallaxRadius, vec);
GLSL_SetUniformVec4(sp, UNIFORM_CUBEMAPINFO, vec);
}