Seems new games (almost all) have a motion blur when u move the mouse.
For me i like it cause it hides the screen tearing of my 225 maxfps on a 75hz lcd monitor.
So, I submit some code to ezquake devs for this addition.
Spike wrote the bulk of this years ago on the QuakeSource forum, i just tweaked it
I call it from r_renderview like so
Though it might need to be tweaked to fit in ezQuake....
For me i like it cause it hides the screen tearing of my 225 maxfps on a 75hz lcd monitor.
So, I submit some code to ezquake devs for this addition.
Spike wrote the bulk of this years ago on the QuakeSource forum, i just tweaked it
void R_RenderSceneBlur (float alpha, GLenum format)
{
extern int sceneblur_texture;
int vwidth = 2, vheight = 2;
float vs, vt;
alpha = bound(0.1, alpha, 0.9);
while (vwidth < glwidth)
{
vwidth *= 2;
}
while (vheight < glheight)
{
vheight *= 2;
}
glViewport (glx, gly, glwidth, glheight);
GL_Bind(sceneblur_texture);
// go 2d
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity ();
glOrtho (0, glwidth, 0, glheight, -99999, 99999);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity ();
vs = ((float)glwidth / vwidth);
vt = ((float)glheight / vheight) ;
glDisable (GL_DEPTH_TEST);
glDisable (GL_CULL_FACE);
glEnable(GL_BLEND);
glColor4f(1, 1, 1, alpha);//<-- alpha of blur
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2f(0, 0);
glTexCoord2f(vs , 0);
glVertex2f(glwidth, 0);
glTexCoord2f(vs , vt);
glVertex2f(glwidth, glheight);
glTexCoord2f(0, vt);
glVertex2f(0, glheight);
glEnd();
glEnable(GL_DEPTH_TEST);
glDepthMask(1);
glColor3f (1,1,1);
glDisable (GL_BLEND);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glCopyTexImage2D(GL_TEXTURE_2D, 0, format, glx, gly, vwidth, vheight, 0);
// glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
}
{
extern int sceneblur_texture;
int vwidth = 2, vheight = 2;
float vs, vt;
alpha = bound(0.1, alpha, 0.9);
while (vwidth < glwidth)
{
vwidth *= 2;
}
while (vheight < glheight)
{
vheight *= 2;
}
glViewport (glx, gly, glwidth, glheight);
GL_Bind(sceneblur_texture);
// go 2d
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity ();
glOrtho (0, glwidth, 0, glheight, -99999, 99999);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity ();
vs = ((float)glwidth / vwidth);
vt = ((float)glheight / vheight) ;
glDisable (GL_DEPTH_TEST);
glDisable (GL_CULL_FACE);
glEnable(GL_BLEND);
glColor4f(1, 1, 1, alpha);//<-- alpha of blur
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2f(0, 0);
glTexCoord2f(vs , 0);
glVertex2f(glwidth, 0);
glTexCoord2f(vs , vt);
glVertex2f(glwidth, glheight);
glTexCoord2f(0, vt);
glVertex2f(0, glheight);
glEnd();
glEnable(GL_DEPTH_TEST);
glDepthMask(1);
glColor3f (1,1,1);
glDisable (GL_BLEND);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glCopyTexImage2D(GL_TEXTURE_2D, 0, format, glx, gly, vwidth, vheight, 0);
// glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
}
I call it from r_renderview like so
if ((cl.stats[STAT_HEALTH]< 0) && (gl_deathblur.value))
{
R_RenderSceneBlur (gl_deathblur.value, GL_RED);
}
else
{
if ((gl_hurtblur.value)&&(cl.hurtblur > cl.time))
{
R_RenderSceneBlur (gl_hurtblur.value, GL_RGB);
}
else
{
if ((cl.items & IT_INVULNERABILITY) && (gl_nightmare.value))
{
R_RenderSceneBlur (gl_nightmare.value, GL_RED);
}
else
{
if (gl_motion_blur.value)
{
R_RenderSceneBlur (gl_motion_blur.value, GL_RGB);
}
}
}
}
{
R_RenderSceneBlur (gl_deathblur.value, GL_RED);
}
else
{
if ((gl_hurtblur.value)&&(cl.hurtblur > cl.time))
{
R_RenderSceneBlur (gl_hurtblur.value, GL_RGB);
}
else
{
if ((cl.items & IT_INVULNERABILITY) && (gl_nightmare.value))
{
R_RenderSceneBlur (gl_nightmare.value, GL_RED);
}
else
{
if (gl_motion_blur.value)
{
R_RenderSceneBlur (gl_motion_blur.value, GL_RGB);
}
}
}
}
Though it might need to be tweaked to fit in ezQuake....