Permalink
Browse files

Minor cleanups/fixes to tiled lighting

  • Loading branch information...
1 parent 368cfdb commit d9747ab7313c516e2e5868c77b2b895f3c4045b9 @cmf028 cmf028 committed Mar 9, 2016
Showing with 3 additions and 6 deletions.
  1. +1 −1 daemon/src/engine/renderer/tr_backend.cpp
  2. +2 −5 daemon/src/engine/renderer/tr_fbo.cpp
@@ -2824,7 +2824,7 @@ void RB_RenderPostDepth()
GL_Viewport( 0, 0, tr.lighttileRenderImage->width, tr.lighttileRenderImage->height );
tess.numIndexes = 0;
- tess.numVertexes = tr.depthtile2RenderImage->width * tr.depthtile2RenderImage->height;
+ tess.numVertexes = tr.lighttileVBO->vertexesNum;
GL_VertexAttribsState( ATTR_POSITION | ATTR_TEXCOORD );
glEnable( GL_POINT_SPRITE );
@@ -399,7 +399,6 @@ void R_InitFBOs()
{
int i;
int width, height;
- int xTiles, yTiles;
Log::Debug("------- R_InitFBOs -------" );
@@ -420,8 +419,6 @@ void R_InitFBOs()
width = NearestPowerOfTwo( glConfig.vidWidth );
height = NearestPowerOfTwo( glConfig.vidHeight );
}
- xTiles = (width + 15) >> 4;
- yTiles = (height + 15) >> 4;
tr.mainFBO[0] = R_CreateFBO( "_main[0]", width, height );
R_BindFBO( tr.mainFBO[0] );
@@ -440,12 +437,12 @@ void R_InitFBOs()
R_AttachFBOTexture2D( GL_TEXTURE_2D, tr.depthtile1RenderImage->texnum, 0 );
R_CheckFBO( tr.depthtile1FBO );
- tr.depthtile2FBO = R_CreateFBO( "_depthtile2", tr.depthtile1RenderImage->width, tr.depthtile1RenderImage->height );
+ tr.depthtile2FBO = R_CreateFBO( "_depthtile2", tr.depthtile2RenderImage->width, tr.depthtile2RenderImage->height );
R_BindFBO( tr.depthtile2FBO );
R_AttachFBOTexture2D( GL_TEXTURE_2D, tr.depthtile2RenderImage->texnum, 0 );
R_CheckFBO( tr.depthtile2FBO );
- tr.lighttileFBO = R_CreateFBO( "_lighttile", xTiles, yTiles );
+ tr.lighttileFBO = R_CreateFBO( "_lighttile", tr.lighttileRenderImage->width, tr.lighttileRenderImage->height );
R_BindFBO( tr.lighttileFBO );
R_AttachFBOTexture3D( tr.lighttileRenderImage->texnum, 0, 0 );
R_CheckFBO( tr.lighttileFBO );

0 comments on commit d9747ab

Please sign in to comment.