only make screentexture for postprocess if we need to
gives quite a neat perfboost on the gpu side
This commit is contained in:
1 parent
e9731d2144
commit
905425f7b9
1 file changed
+11
-13
+11
-13
@@ -345,7 +345,6 @@ static void HWR_SetShaderState(void)
|
||||
GL_SetSpecialState(HWD_SET_SHADERS, HWR_UseShader() ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
static boolean HWR_IsWireframeMode(void)
|
||||
{
|
||||
return (cv_glwireframe.value /*&& cv_debug*/);
|
||||
@@ -4269,7 +4268,6 @@ static void *HWR_CreateDrawNode(gl_drawnode_type_t type)
|
||||
Z_Realloc(drawnodes, alloceddrawnodes * sizeof(gl_drawnode_t), PU_LEVEL, &drawnodes);
|
||||
}
|
||||
|
||||
|
||||
drawnode = &drawnodes[numdrawnodes++];
|
||||
drawnode->type = type;
|
||||
|
||||
@@ -5931,7 +5929,6 @@ static void COM_HWR_glinfo(void)
|
||||
CONS_Printf("Unrecognized argument: %s\n", argv);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
CONS_Printf("\x88OpenGL %s\x80\n", gl_version);
|
||||
@@ -6025,7 +6022,7 @@ static void HWR_DoPostProcessor(player_t *player)
|
||||
|
||||
// Armageddon Blast Flash!
|
||||
// Could this even be considered postprocessor?
|
||||
if (!HWR_PalRenderFlashpal() && player->flashcount)
|
||||
if (player->flashcount && !HWR_PalRenderFlashpal())
|
||||
{
|
||||
FOutVector v[4];
|
||||
FSurfaceInfo Surf;
|
||||
@@ -6051,19 +6048,19 @@ static void HWR_DoPostProcessor(player_t *player)
|
||||
if (cv_glscreentextures.value != 2) // screen textures are needed for the rest of the effects
|
||||
return;
|
||||
|
||||
// Capture the screen for intermission and screen waving
|
||||
if (gamestate != GS_INTERMISSION)
|
||||
GL_MakeScreenTexture(HWD_SCREENTEXTURE_GENERIC1);
|
||||
|
||||
if (splitscreen) // Not supported in splitscreen - someone want to add support?
|
||||
return;
|
||||
|
||||
//UINT8 viewnum = R_GetViewNumber(); // see above
|
||||
//UINT8 viewnum = R_GetViewNumber(); // see below
|
||||
//camera_t *thiscam = &camera[viewnum];
|
||||
camera_t *thiscam = &camera[0];
|
||||
|
||||
// Not supported in splitscreen - someone want to add support?
|
||||
const boolean screenwave = (!splitscreen && (thiscam->postimg & POSTIMG_WATER || thiscam->postimg & POSTIMG_HEAT));
|
||||
|
||||
// Capture the screen for intermission and screen waving
|
||||
if ((lastdraw || screenwave) && gamestate != GS_INTERMISSION)
|
||||
GL_MakeScreenTexture(HWD_SCREENTEXTURE_GENERIC1);
|
||||
|
||||
// Drunken vision! WooOOooo~
|
||||
if (thiscam->postimg & POSTIMG_WATER || thiscam->postimg & POSTIMG_HEAT)
|
||||
if (screenwave)
|
||||
{
|
||||
// 10 by 10 grid. 2 coordinates (xy)
|
||||
float v[SCREENVERTS][SCREENVERTS][2];
|
||||
@@ -6097,6 +6094,7 @@ static void HWR_DoPostProcessor(player_t *player)
|
||||
v[x][y][1] = (y/((float)(SCREENVERTS-1.0f)/9.0f))-4.5f;
|
||||
}
|
||||
}
|
||||
|
||||
GL_PostImgRedraw(v);
|
||||
|
||||
// Capture the screen again for screen waving on the intermission
|
||||
|
||||
Reference in new issue
Block a user