summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_backend.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_backend.c
parente3ac1437c4e4df764cc3279324fab7e3ee032e2a (diff)
OpenGL2: Parse radius entries from misc_cubemap entities.
Diffstat (limited to 'src/renderergl2/tr_backend.c')
-rw-r--r--src/renderergl2/tr_backend.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/renderergl2/tr_backend.c b/src/renderergl2/tr_backend.c
index 2a61e114..ad43e5b2 100644
--- a/src/renderergl2/tr_backend.c
+++ b/src/renderergl2/tr_backend.c
@@ -483,8 +483,9 @@ void RB_BeginDrawingView (void) {
// FIXME: hack for cubemap testing
if (tr.renderCubeFbo && backEnd.viewParms.targetFbo == tr.renderCubeFbo)
{
+ cubemap_t *cubemap = &tr.cubemaps[backEnd.viewParms.targetFboCubemapIndex];
//qglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X + backEnd.viewParms.targetFboLayer, backEnd.viewParms.targetFbo->colorImage[0]->texnum, 0);
- qglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X + backEnd.viewParms.targetFboLayer, tr.cubemaps[backEnd.viewParms.targetFboCubemapIndex]->texnum, 0);
+ qglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X + backEnd.viewParms.targetFboLayer, cubemap->image->texnum, 0);
}
}
}
@@ -1312,9 +1313,11 @@ const void *RB_DrawSurfs( const void *data ) {
if (glRefConfig.framebufferObject && tr.renderCubeFbo && backEnd.viewParms.targetFbo == tr.renderCubeFbo)
{
+ cubemap_t *cubemap = &tr.cubemaps[backEnd.viewParms.targetFboCubemapIndex];
+
FBO_Bind(NULL);
GL_SelectTexture(TB_CUBEMAP);
- GL_BindToTMU(tr.cubemaps[backEnd.viewParms.targetFboCubemapIndex], TB_CUBEMAP);
+ GL_BindToTMU(cubemap->image, TB_CUBEMAP);
qglGenerateMipmapEXT(GL_TEXTURE_CUBE_MAP);
GL_SelectTexture(0);
}
@@ -1725,7 +1728,7 @@ const void *RB_PostProcess(const void *data)
{
VectorSet4(dstBox, 0, glConfig.vidHeight - 256, 256, 256);
//FBO_BlitFromTexture(tr.renderCubeImage, NULL, NULL, NULL, dstBox, &tr.testcubeShader, NULL, 0);
- FBO_BlitFromTexture(tr.cubemaps[cubemapIndex - 1], NULL, NULL, NULL, dstBox, &tr.testcubeShader, NULL, 0);
+ FBO_BlitFromTexture(tr.cubemaps[cubemapIndex - 1].image, NULL, NULL, NULL, dstBox, &tr.testcubeShader, NULL, 0);
}
}
#endif