Finally - after ridiculously many hours of debugging, I've found the source of the RiceVideo flashing problem with Mario Kart, and the fix for it. At least along the way I learned a lot about things like homogeneous coordinate systems, polygon clipping, the OpenGL pipeline, and the RiceVideo renderers.
So here is what was happening to cause these artifacts. First, one frame would be rendered to the (blank RGB and Z) hidden frame buffer. Then the problem occurred, because sometimes the UpdateFrame function would not be called and the buffers would not be swapped. So next, another frame was rendered *on top* of the first. The background would first be copied over the entire frame in the RGB space, but the Z buffer would remain untouched. So when the second frame was rendered on top of it, only the new pixels that were *in front* of the pixels from the previous frame would be rendered; otherwise you'd see the background.
While searching for the fix I found that RiceVideo has a mechanism for selecting at what times the UpdateFrame function could be called. So the fix is very simple - by adding the line "ScreenUpdateSetting=1" to the MarioKart section in your '.ini' file, the screen will be properly updated and these artifacts will not occur.
Happy Karting!
I think I'm going to rip all of the remaining Win32 code out of my RiceVideo plugin and make it Linux-only, supporting both 32-bit and 64-bit systems. The D3D stuff was already ripped out by Hacktarux, so it's not worth much to Windows users now anyway. And the remaining WIN32 stuff just clutters up the code with all this crap, so I'll probably take some time and get rid of it all so that we can have a clean Linux implementation.
So here is what was happening to cause these artifacts. First, one frame would be rendered to the (blank RGB and Z) hidden frame buffer. Then the problem occurred, because sometimes the UpdateFrame function would not be called and the buffers would not be swapped. So next, another frame was rendered *on top* of the first. The background would first be copied over the entire frame in the RGB space, but the Z buffer would remain untouched. So when the second frame was rendered on top of it, only the new pixels that were *in front* of the pixels from the previous frame would be rendered; otherwise you'd see the background.
While searching for the fix I found that RiceVideo has a mechanism for selecting at what times the UpdateFrame function could be called. So the fix is very simple - by adding the line "ScreenUpdateSetting=1" to the MarioKart section in your '.ini' file, the screen will be properly updated and these artifacts will not occur.
I think I'm going to rip all of the remaining Win32 code out of my RiceVideo plugin and make it Linux-only, supporting both 32-bit and 64-bit systems. The D3D stuff was already ripped out by Hacktarux, so it's not worth much to Windows users now anyway. And the remaining WIN32 stuff just clutters up the code with all this crap, so I'll probably take some time and get rid of it all so that we can have a clean Linux implementation.