Edit: I prefer playing with motion blur.

I basically emulated the accumulation buffer. When the video is set up I create some additional pbuffer-related stuff, then leave the pbuffer context the current context. Then every subframe, switch to the framebuffer and draw the texture with 1.0 / ++count alpha. If it is the last subframe, swap. Finally, switch back to the pbuffer.z-man wrote:While we're talking about fillrate: the accumulation buffer, due to the copying around of memory, eats away a lot of fillrate. Directly rendering to a texture (via pbuffers) sounds like the better option even if the accumulation buffer is supported.
Not for the basic operation. Maybe, if texture memory is plenty, it may be better to render each subframe into a separate buffer and blend them together with multitexturing.Jonathan wrote:Do you have a better idea?
I thought about that too, but decided not to do it because I'd need to manage more stuff, and didn't have anything working yet. I have something working now, and I have 64 MB VRAM, not the latest and greatest, but plenty, so I can give it a try. I'm not sure exactly how it works internally, but it may also improve parallelism.z-man wrote:Maybe, if texture memory is plenty, it may be better to render each subframe into a separate buffer and blend them together with multitexturing.
Yes and no. Yes in the sense that you just have to activate VSYNC in your video driver and let it take care of the syncing of full frames.iceman wrote:is this possible to do ?
You know what's fun? When programs smooth the time when accurate microsecond times are available on another OS.z-man wrote:We have bad frame jumping? If so, I think we can blame it on the inaccurate timer we use in Windows
Code: Select all
#ifdef WIN32
#include <windows.h>
#include <sys/timeb.h>
#ifndef DEDICATED
#include "rSDL.h"
#endif
void GetTime( tTime & time )
{
struct _timeb tstruct;
LARGE_INTEGER mtime,frq;
// Check if high-resolution performance counter is supported
if (!QueryPerformanceFrequency(&frq))
{
// Nope, not supported, do it the old way.
_ftime( &tstruct );
time.microseconds = tstruct.millitm*1000;
time.seconds = tstruct.time;
}
else
{
QueryPerformanceCounter(&mtime);
time.microseconds = (mtime.QuadPart/(frq.QuadPart/1000000)) %1000000;
time.seconds = mtime.QuadPart/frq.QuadPart ;
}
time.Normalize();
}