Hi,
I’ve been using Fraps a bit recently, but it struggles sometimes and I have problems with broken audio, missing frames etc. I’d like to be able to record interaction with an application better than Fraps on my machine currently allows me to. I’d greatly appreciate any feedback on this. I hope someone finds this post worth reading… or lets me know why it isn’t. Of course I’d dearly love a simpler solution.
One possibility is to have an application specific recording feature, which could record all relevant aspects of the applications’ state so that it could reproduce the rendering. In a program which doesn’t already have these features (and doesn’t need them for anything else), it could mean quite a lot of not very reusable code…
So I wonder if it would be practical to implement a general method for recording all GL calls along with sufficient timing information, such that they could later be faithfully reproduced and synched with an audio recording. Either an alternative GL interface implementation could be created (similar to DebugGL), or something like AspectJ could be used to intercept calls. Copies would be made of all passed parameters… hopefully avoiding too much runtime reflection, which could be a killer if there were a lot of calls to be processed.
The amount of data would often be less than the image data that something like Fraps has to deal with. Applications constantly requiring a lot of throughput would be inappropriate, what with writing to disk not being quite as fast as PCIe-x16 ;). In some cases it would be very small; this depends a lot on the application. As it happens, some of my own work is ‘generative art’ type stuff, which often needs only a few draw calls with absolutely minute amounts of data - but which I am not able to record at decent resolution with Fraps. I would be mainly using this initially for an application with moderate amounts of dynamic geometry and some other data being shunted through GL.
The first main implementation problem that springs to mind would be dealing with handles (for textures, shaders, buffers etc); recognising when they are generated and later referenced. A lot of extra logic would need to be devoted to this, and this may involve quite a lot of hand-coding. This might be somewhat automatable by being able to recognise name like glGen*, glBind*, glGet*… but this wouldn’t catch everything and there are thousands of GL methods, plus CgGL and anything else I’ve missed out… so at first it would only support an application-specific subset of the spec. Automated tests may help as more of the spec is covered.
If anyone with better knowledge of OpenGL knows of a formal way that relevant properties could be recognised, that would be particularly useful. If I do decide to go ahead with this, I’ll start an LGPL project and of course contributions would be welcomed…
There are undoubtedly other potential gotchas that haven’t occurred to me (or have slipped my mind), but it seems to me that this could be reasonably achievable and also I hope useful.
Cheers,
Peter