summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_backend.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2016-03-10 03:44:21 -0800
committerTim Angus <tim@ngus.net>2016-04-07 11:54:14 +0100
commit46cb9a5112fecbdf152bccf692d89bfca564e987 (patch)
tree45ef8756f9fd27d1256500758ad01946ccbf90b6 /src/renderergl2/tr_backend.c
parent026f8e89306cc9783c40d75f300c77ab8688cf9b (diff)
OpenGL2: Fixes to depth blur and ssao.
Diffstat (limited to 'src/renderergl2/tr_backend.c')
-rw-r--r--src/renderergl2/tr_backend.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/renderergl2/tr_backend.c b/src/renderergl2/tr_backend.c
index 420c785b..708b395f 100644
--- a/src/renderergl2/tr_backend.c
+++ b/src/renderergl2/tr_backend.c
@@ -978,7 +978,7 @@ const void *RB_DrawSurfs( const void *data ) {
qglCopyTextureImage2D(tr.renderDepthImage->texnum, GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT24, 0, 0, glConfig.vidWidth, glConfig.vidHeight, 0);
}
- if (r_ssao->integer)
+ if (tr.hdrDepthFbo)
{
// need the depth in a texture we can do GL_LINEAR sampling on, so copy it to an HDR image
FBO_BlitFromTexture(tr.renderDepthImage, NULL, NULL, tr.hdrDepthFbo, NULL, NULL, NULL, 0);
@@ -1080,7 +1080,6 @@ const void *RB_DrawSurfs( const void *data ) {
RB_InstantQuad2(quadVerts, texCoords);
-
FBO_Bind(tr.screenShadowFbo);
GLSL_BindProgram(&tr.depthBlurShader[1]);
@@ -1101,6 +1100,7 @@ const void *RB_DrawSurfs( const void *data ) {
viewInfo[2] = 1.0f / ((float)(tr.quarterImage[0]->width) * tan(backEnd.viewParms.fovX * M_PI / 360.0f) * 2.0f);
viewInfo[3] = 1.0f / ((float)(tr.quarterImage[0]->height) * tan(backEnd.viewParms.fovY * M_PI / 360.0f) * 2.0f);
+ viewInfo[3] *= (float)backEnd.viewParms.viewportHeight / (float)backEnd.viewParms.viewportWidth;
FBO_Bind(tr.quarterFbo[0]);
@@ -1542,9 +1542,6 @@ const void *RB_PostProcess(const void *data)
srcBox[3] = backEnd.viewParms.viewportHeight * tr.screenSsaoImage->height / (float)glConfig.vidHeight;
//FBO_BlitFromTexture(tr.screenSsaoImage, srcBox, NULL, srcFbo, dstBox, NULL, NULL, GLS_SRCBLEND_DST_COLOR | GLS_DSTBLEND_ZERO);
- srcBox[1] = tr.screenSsaoImage->height - srcBox[1];
- srcBox[3] = -srcBox[3];
-
FBO_Blit(tr.screenSsaoFbo, srcBox, NULL, srcFbo, dstBox, NULL, NULL, GLS_SRCBLEND_DST_COLOR | GLS_DSTBLEND_ZERO);
}