absolutely disgusting hack for sky issues
instead of homremoval, we draw the fucking skyplane before everything lmao there probably is a right way to fix this, but im too dumb for that needs some performance testing, but since i could move the semaphores back, its even better in some instances
This commit is contained in:
1 parent
a8005d5cec
commit
da706d89a5
3 files changed
+43
-9
No files matched your search
+5
-1
@@ -1391,13 +1391,15 @@ void R_RenderPlayerView(player_t *player)
|
||||
|
||||
R_ClearClipSegs();
|
||||
R_ClearDrawSegs();
|
||||
R_DrawSkyPlanes();
|
||||
R_ClearPlanes();
|
||||
R_ClearSprites();
|
||||
|
||||
R_RenderViewpoint(&masks[nummasks - 1], false);
|
||||
|
||||
R_ClipSprites(drawsegs, NULL);
|
||||
R_DrawSkyPlanes(); // draw the fucker again to prevent some artifacts
|
||||
R_DrawPlanes();
|
||||
// well sometimes synchronization is off and may result in some visual glitching, oh well
|
||||
R_DrawMasked(masks, nummasks);
|
||||
}
|
||||
PS_STOP_TIMING(ps_skyboxtime);
|
||||
@@ -1479,6 +1481,8 @@ void R_RenderPlayerView(player_t *player)
|
||||
PS_STOP_TIMING(ps_sw_portaltime);
|
||||
|
||||
PS_START_TIMING(ps_sw_planetime);
|
||||
if (!skybox)
|
||||
R_DrawSkyPlanes();
|
||||
R_DrawPlanes();
|
||||
PS_STOP_TIMING(ps_sw_planetime);
|
||||
// draw mid texture and sprite
|
||||
|
||||
+37
-8
@@ -698,9 +698,9 @@ void R_DrawPlanes(void)
|
||||
|
||||
R_UpdatePlaneRipple(&ds);
|
||||
|
||||
srb2::g_main_threadpool->begin_sema();
|
||||
for (i = 0; i < MAXVISPLANES; i++, pl++)
|
||||
{
|
||||
srb2::g_main_threadpool->begin_sema();
|
||||
for (pl = visplanes[i]; pl; pl = pl->next)
|
||||
{
|
||||
if (pl->ffloor != NULL || pl->polyobj != NULL)
|
||||
@@ -708,10 +708,37 @@ void R_DrawPlanes(void)
|
||||
|
||||
R_DrawSinglePlane(&ds, pl, cv_parallelsoftware.value);
|
||||
}
|
||||
tp_sema = srb2::g_main_threadpool->end_sema();
|
||||
srb2::g_main_threadpool->notify_sema(tp_sema);
|
||||
srb2::g_main_threadpool->wait_sema(tp_sema);
|
||||
}
|
||||
tp_sema = srb2::g_main_threadpool->end_sema();
|
||||
srb2::g_main_threadpool->notify_sema(tp_sema);
|
||||
srb2::g_main_threadpool->wait_sema(tp_sema);
|
||||
}
|
||||
|
||||
static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc2)(drawcolumndata_t*), boolean allow_parallel);
|
||||
|
||||
void R_DrawSkyPlanes(void)
|
||||
{
|
||||
visplane_t *pl;
|
||||
INT32 i;
|
||||
srb2::ThreadPool::Sema tp_sema;
|
||||
|
||||
srb2::g_main_threadpool->begin_sema();
|
||||
for (i = 0; i < MAXVISPLANES; i++, pl++)
|
||||
{
|
||||
for (pl = visplanes[i]; pl; pl = pl->next)
|
||||
{
|
||||
if (pl->ffloor != NULL || pl->polyobj != NULL)
|
||||
continue;
|
||||
|
||||
if (pl->picnum != skyflatnum)
|
||||
continue;
|
||||
|
||||
R_DrawSkyPlane(pl, colfunc, cv_parallelsoftware.value);
|
||||
}
|
||||
}
|
||||
tp_sema = srb2::g_main_threadpool->end_sema();
|
||||
srb2::g_main_threadpool->notify_sema(tp_sema);
|
||||
srb2::g_main_threadpool->wait_sema(tp_sema);
|
||||
}
|
||||
|
||||
static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc2)(drawcolumndata_t*), boolean allow_parallel)
|
||||
@@ -723,9 +750,6 @@ static void R_DrawSkyPlane(visplane_t *pl, void(*colfunc2)(drawcolumndata_t*), b
|
||||
// This probably utterly ruins sky rendering for FOFs and polyobjects, unfortunately
|
||||
if (!newview->sky)
|
||||
{
|
||||
// Mark that the sky was visible here for next tic
|
||||
// (note: this is a hack and it sometimes can cause HOMs to appear for a tic IIRC)
|
||||
skyVisible = true;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -941,7 +965,12 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
|
||||
// sky flat
|
||||
if (pl->picnum == skyflatnum)
|
||||
{
|
||||
R_DrawSkyPlane(pl, colfunc, allow_parallel);
|
||||
// horrific
|
||||
if (!newview->sky)
|
||||
{
|
||||
skyVisible = true;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ void R_AllocPlaneMemory(void);
|
||||
void R_ClearPlanes(void);
|
||||
void R_ClearFFloorClips (void);
|
||||
|
||||
void R_DrawSkyPlanes(void);
|
||||
void R_DrawPlanes(void);
|
||||
|
||||
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t xoff, fixed_t yoff, angle_t plangle,
|
||||
|
||||
Reference in new issue
Block a user