Skip to content

Commit 56b36ef

Browse files
author
d
committed
Spring cleaning of old deprecated/broken post-process GLSL experiments
- r_anime broke in 2015 - r_tvMode - well, shaderglass exists now - r_motionblur - Bad technique, too much memory - t_pslettize - slow, relies on shader's lookup of a vector table - r_film - bad on well-lit maps - r_retroAA - this broke early too. also looked bad. would rather implement FSAA 4x
1 parent 63a47e7 commit 56b36ef

File tree

8 files changed

+6
-1367
lines changed

8 files changed

+6
-1367
lines changed

code/renderer_oa/tr_backend.c

Lines changed: 0 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,9 +1062,6 @@ RB_SetGL2D
10621062
10631063
================
10641064
*/
1065-
extern int tvWidth;
1066-
extern int tvHeight;
1067-
10681065
extern int vresWidth;
10691066
extern int vresHeight;
10701067

@@ -1456,143 +1453,6 @@ const void *RB_ClearDepth(const void *data)
14561453
return (const void *)(cmd + 1);
14571454
}
14581455

1459-
// leilei - motion blur hack
1460-
float motiontime;
1461-
float motion_finished;
1462-
int motionframe;
1463-
int motionpasses;
1464-
int numofmotionpasses;
1465-
int inmotion;
1466-
1467-
int mblurred; // tells the renderer if we are rendering to a motion blur accum buffer instead of our drawing buffer
1468-
int mpasses; // how many passes of motion blur we should render.
1469-
1470-
float motioner;
1471-
1472-
void R_TVScreen( void );
1473-
void R_RetroAAScreen( void );
1474-
1475-
void R_MblurScreen( void );
1476-
void R_MblurScreenPost( void );
1477-
void RB_UpdateMotionBlur (void){
1478-
// leilei - motion blur hack
1479-
numofmotionpasses = 4;
1480-
numofmotionpasses = backEnd.refdef.time - backEnd.refdef.floatTime / 1000.0f;
1481-
1482-
motioner = (backEnd.refdef.time - motiontime);
1483-
numofmotionpasses = (int)motioner / 3;
1484-
1485-
1486-
1487-
// unfortunately doing this with some math just causes it to loop
1488-
if (numofmotionpasses == 4) numofmotionpasses = 0;
1489-
else if (numofmotionpasses == 3) numofmotionpasses = 1;
1490-
else if (numofmotionpasses == 2) numofmotionpasses = 2;
1491-
else if (numofmotionpasses == 1) numofmotionpasses = 3;
1492-
else if (numofmotionpasses == 0) numofmotionpasses = 4;
1493-
//else numofmotionpasses = 0;
1494-
1495-
//ri.Printf( PRINT_WARNING, "hah %i\n", numofmotionpasses);
1496-
mpasses = floor(numofmotionpasses);
1497-
if (mpasses > 4) mpasses = 4;
1498-
if (mpasses < 1) return; // JUST DONT!!
1499-
motion_finished = (1000.0f / r_motionblur_fps->integer / 5 / mpasses);
1500-
1501-
1502-
if (motionpasses > numofmotionpasses){
1503-
motionpasses = 0;
1504-
}
1505-
1506-
if (motionframe > 5){
1507-
1508-
// do an accumulating post process
1509-
motionpasses += 1;
1510-
// R_MotionBlur_BackupScreen(10 + motionpasses);
1511-
R_MotionBlur_BackupScreen(11); // back it up in there...
1512-
motionframe = 1;
1513-
//return;
1514-
}
1515-
1516-
if (backEnd.refdef.time > motiontime){
1517-
R_MotionBlur_BackupScreen(motionframe); // back it up in there...
1518-
motionframe += 1;
1519-
R_MblurScreen();
1520-
motiontime = backEnd.refdef.time + motion_finished;
1521-
inmotion = 1;
1522-
1523-
}
1524-
else
1525-
inmotion = 0;
1526-
}
1527-
1528-
1529-
float mtime; // motion blur frame time
1530-
1531-
//
1532-
// leilei - accumulation buffer-based motion blur, a much more legacy technique
1533-
// code addapted from MH's "Quake motion blur" thread (which is intended for GLQuake)
1534-
// but made to work with our cvars relating to the crappy pixel shader'd motion blur
1535-
// i coded on a whim one day.
1536-
//
1537-
1538-
float mblur_time;
1539-
float mblur_timelast;
1540-
1541-
float time_now;
1542-
float time_last;
1543-
float mbluracc;
1544-
int mblurredframes;
1545-
int mblurredframestotal;
1546-
void RB_AccumBlurValue (void)
1547-
{
1548-
// calculate how much we need, determined by motion blur fps
1549-
mblur_time = time_now - time_last;
1550-
mbluracc = (mblur_time) / 32;
1551-
mbluracc *= -1;
1552-
mbluracc += 1.0f;
1553-
mbluracc /= 2;
1554-
};
1555-
1556-
void RB_DrawAccumBlur (void)
1557-
{
1558-
static int blurstate = 0;
1559-
float accblur;
1560-
1561-
if (r_tvMode->integer > -1) return; // tvmode causes this to crash
1562-
if (!r_motionblur->integer) return;
1563-
if (r_motionblur->integer > 1) return; // don't do it for the other motion blur techniques
1564-
1565-
RB_AccumBlurValue ();
1566-
accblur = mbluracc;
1567-
1568-
//ri.Printf( PRINT_WARNING, "accum value %f\n", mbluracc );
1569-
// if (accblur > 1.0f)
1570-
// accblur = 0.5f;
1571-
1572-
if (accblur <= 0.0f)
1573-
{
1574-
// reinit if we're not blurring so that the contents of the
1575-
// accumulation buffer are valid for the frame
1576-
blurstate = 0;
1577-
return;
1578-
}
1579-
1580-
if (!blurstate)
1581-
{
1582-
// load the scene into the accumulation buffer
1583-
qglAccum (GL_LOAD, 1.0f);
1584-
}
1585-
else
1586-
{
1587-
qglAccum (GL_LOAD, 1.0f);
1588-
qglAccum (GL_MULT, accblur); // scale contents of accumulation buffer
1589-
qglAccum (GL_ACCUM, 1.0f - accblur); // add screen contents
1590-
qglAccum (GL_RETURN, 1.0f); // read result back
1591-
}
1592-
1593-
blurstate = 1;
1594-
}
1595-
15961456
/*
15971457
=============
15981458
RB_SwapBuffers
@@ -1608,15 +1468,6 @@ const void *RB_SwapBuffers( const void *data ) {
16081468
RB_EndSurface();
16091469
}
16101470

1611-
if (r_motionblur->integer > 2){
1612-
{
1613-
mtime = backEnd.refdef.time + (1000.0f / r_motionblur_fps->integer);
1614-
mblurred = 0;
1615-
RB_UpdateMotionBlur();
1616-
}
1617-
}
1618-
1619-
16201471
// texture swapping test
16211472
if ( r_showImages->integer ) {
16221473
RB_ShowImages();
@@ -1633,13 +1484,6 @@ const void *RB_SwapBuffers( const void *data ) {
16331484
}
16341485

16351486

1636-
if (r_motionblur->integer == 1){
1637-
RB_DrawAccumBlur ();
1638-
1639-
}
1640-
1641-
1642-
16431487
R_BrightScreen(); // leilei - alternate brightness - do it here so we hit evereything that represents our video buffer
16441488

16451489
cmd = (const swapBuffersCommand_t *)data;
@@ -1678,17 +1522,11 @@ const void *RB_SwapBuffers( const void *data ) {
16781522
backEnd.donewater = qfalse;
16791523
backEnd.donepostproc = qfalse;
16801524
backEnd.doneAltBrightness = qfalse;
1681-
backEnd.doneFilm = qfalse;
16821525
backEnd.doneleifx = qfalse;
1683-
backEnd.doneanime = qfalse;
16841526
backEnd.donepalette = qfalse;
1685-
backEnd.donemblur = qfalse;
16861527
backEnd.doneSurfaces = qfalse;
16871528
backEnd.doneSun = qfalse;
16881529
backEnd.doneSunFlare = qfalse;
1689-
backEnd.donentsc = qfalse;
1690-
backEnd.donetv = qfalse;
1691-
backEnd.doneraa = qfalse;
16921530
backEnd.doneParticles = qfalse;
16931531

16941532
// leilei - only reset this every 15hz to keep it fast and synchronized
@@ -1697,7 +1535,6 @@ const void *RB_SwapBuffers( const void *data ) {
16971535
backEnd.flareTestTime = backEnd.refdef.time + 100.0f;
16981536
}
16991537

1700-
time_last = backEnd.refdef.time;
17011538
return (const void *)(cmd + 1);
17021539
}
17031540

@@ -1710,7 +1547,6 @@ void RB_ExecuteRenderCommands( const void *data ) {
17101547
int t1, t2;
17111548

17121549
t1 = ri.Milliseconds ();
1713-
time_now = t1;
17141550

17151551
while ( 1 ) {
17161552
data = PADP(data, sizeof(void *));
@@ -1724,7 +1560,6 @@ void RB_ExecuteRenderCommands( const void *data ) {
17241560
leifxmode = 0;
17251561
R_PostprocessScreen();
17261562
R_BloomScreen();
1727-
R_FilmScreen();
17281563
data = RB_StretchPic( data );
17291564
break;
17301565
case RC_DRAW_SURFS:
@@ -1738,7 +1573,6 @@ void RB_ExecuteRenderCommands( const void *data ) {
17381573
leifxmode = 0;
17391574
R_PostprocessScreen();
17401575
R_BloomScreen();
1741-
R_FilmScreen();
17421576
data = RB_SwapBuffers( data );
17431577
break;
17441578
case RC_SCREENSHOT:

0 commit comments

Comments
 (0)