Moderators: Nexuiz Moderators, Moderators
Samual wrote:Alright well I did something wrong here, I wrote a small AccumBuffer and something just isn't working. Halp!!!!!
mand1nga wrote:Samual wrote:Alright well I did something wrong here, I wrote a small AccumBuffer and something just isn't working. Halp!!!!!
What are you trying to do?
Why don't you use the existing blur effect from client qc?
tundramagi wrote:Isn't motion blur used on 24FPS movies to make fast action look more smooth?
How much gpu/cpu does it use... my intel card could use some of that smoothing (and probably can't do it)
Samual wrote:tundramagi wrote:Isn't motion blur used on 24FPS movies to make fast action look more smooth?
How much gpu/cpu does it use... my intel card could use some of that smoothing (and probably can't do it)
Well it would only make it slower for you, sorry. But good news everyone.. I GOT IT TO WORK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (I KNOW RIGHT?!)
Only supported platform currently is Windows (And this won't change unless I get a lot of help), and compiling this little fucker is a bitch.... Literally, it's almost impossible without hours of troubleshooting. So until I become a better coder, it's not viable.
As for performance, I noticed a 17% drop in framerate (From 170), so it was very usable to me. Blur amounts can't be adjusted quite yet, i'm sure in a release i'll implement settings for it.
Good job, Can you post some screenshots?
If it's window's only it might not get in. Linux is the main dev platform and crossplatform support is always aimed at from what I've seen. Why is it win only? Isn't OpenGL cross platform? You should beable to get it to work on both with OpenGL.
=========== Main Code, gl_rmain.c ============
Need this to compile: #include <gl\gl.h>
Code:
extern cvar_t r_motionblur;
void DrawAccumBlur (void)
{
static int blurstate = 0;
float accblur;
static float damagetime = -1.0f;
if (!r_motionblur.value) return;
// evaluate blur conditions
if (cl.stats[STAT_HEALTH] <= 0)
{
// being dead always overrides everything else
accblur = 0.75f;
}
else if (cl.cshifts[CSHIFT_DAMAGE].percent)
{
// initial damage blur
accblur = 0.75f;
damagetime = 0.5f;
}
else if (cl.cshifts[CSHIFT_CONTENTS].percent)
{
// blur less if underwater
accblur = 0.666f;
}
else accblur = -1.0f;
if (accblur <= 0.0f)
{
// reinit if we're not blurring so that the contents of the
// accumulation buffer are valid for the frame
blurstate = 0;
return;
}
if (!blurstate)
{
// load the scene into the accumulation buffer
qglAccum (GL_LOAD, 1.0f);
}
else
{
qglAccum (GL_MULT, accblur); // scale contents of accumulation buffer
qglAccum (GL_ACCUM, 1.0f - accblur); // add screen contents
qglAccum (GL_RETURN, 1.0f); // read result back
}
blurstate = 1;
}
=========== Variable setup, gl_rmain.c ============
At the top: cvar_t r_motionblur = {CVAR_SAVE, "r_motionblur", "0", "motion blur testing"};
Respectively with others: Cvar_RegisterVariable(&r_motionblur);
=========== Declaration stuff, glquake.h ============
Under GL_ARB_multitexture: extern void (GLAPIENTRY *qglAccum)(GLenum op, GLfloat value);
=========== Declaration stuff, vid_shared.c ===========
Under GL_ARB_multitexture: void (GLAPIENTRY *qglAccum)(GLenum op, GLfloat value);
In opengl110funcs array: {"glAccum", (void **) &qglAccum},
tundramagi wrote:This is awsome. I can't wait to try it on the nvidia box.
I'll use slomo + motion blur to get a real movie effect.
Return to Nexuiz - Development
Users browsing this forum: No registered users and 1 guest