summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_backend.c
diff options
context:
space:
mode:
authorSmileTheory <SmileTheory@gmail.com>2016-03-08 18:30:51 -0800
committerTim Angus <tim@ngus.net>2016-04-07 11:54:14 +0100
commitc1ec25db8442cacf87df39d1e8e54b819b83a047 (patch)
tree2cf21e9807ba7bb7e384c787023bc34f2edc6e8e /src/renderergl2/tr_backend.c
parent7c858dafb7941be2ea6522a2a267252abf2d4fe7 (diff)
OpenGL2: Speedup for SSAO & blur shaders, fix sunlight normals in lightall.
Diffstat (limited to 'src/renderergl2/tr_backend.c')
-rw-r--r--src/renderergl2/tr_backend.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/renderergl2/tr_backend.c b/src/renderergl2/tr_backend.c
index e0715d04..420c785b 100644
--- a/src/renderergl2/tr_backend.c
+++ b/src/renderergl2/tr_backend.c
@@ -1099,8 +1099,8 @@ const void *RB_DrawSurfs( const void *data ) {
vec4_t quadVerts[4];
vec2_t texCoords[4];
- viewInfo[2] = 1.0f / (float)(tr.quarterImage[0]->width);
- viewInfo[3] = 1.0f / (float)(tr.quarterImage[0]->height);
+ 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);
FBO_Bind(tr.quarterFbo[0]);
@@ -1128,6 +1128,9 @@ const void *RB_DrawSurfs( const void *data ) {
RB_InstantQuad2(quadVerts, texCoords); //, color, shaderProgram, invTexRes);
+ viewInfo[2] = 1.0f / (float)(tr.quarterImage[0]->width);
+ viewInfo[3] = 1.0f / (float)(tr.quarterImage[0]->height);
+
FBO_Bind(tr.quarterFbo[1]);
qglViewport(0, 0, tr.quarterFbo[1]->width, tr.quarterFbo[1]->height);