From c1ec25db8442cacf87df39d1e8e54b819b83a047 Mon Sep 17 00:00:00 2001 From: SmileTheory Date: Tue, 8 Mar 2016 18:30:51 -0800 Subject: OpenGL2: Speedup for SSAO & blur shaders, fix sunlight normals in lightall. --- src/renderergl2/tr_backend.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/renderergl2/tr_backend.c') 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); -- cgit