MATLAB: Cannot use GETFRAME when rendering in OpenGL

getframeopengl

I'm trying to render this code:
myVideo=VideoWriter('video.avi');
myVideo.FrameRate=4;
open(myVideo);
fnPLOT % Plots a patch graphic to an axes
for index=1:10
fnRotate % rotates the rendered graphic
drawnow
currFrame=getFrame(gcf);
writeVideo(myVideo,currFrame);
end
close(myVideo);
This makes a figure animation that rotates. The problem is that getFrame grabs a blank frame rather than the figure.
System: Windows-7×64, Matlab R2011a, Nvidia GeForce GTX 280M (SLI)
What I've tried:
1. Switching to zbuffers as the rendering engine works. However, my patch has alpha (transparancy) properties which are not rendered using zbuffers.
2. Disabled Aero interface (never used it to begin with)
3. Tried on dual monitor setup and single monitor.
4. Tried using figure embedded ("docked") within Java GUI
5. Tried assigning figure handle to figure, and using getFrame(h).
6. Tried capturing frames to a structure variable, then outputing that variable using the writeVideo command.
F(index)=getFrame;
end
writeVideo(myVideo,F);
close(myVideo);
None of these seem to work. Has anyone else run into this difficulty?

Best Answer

Try this, but don't use a docked figure. Just use GETFRAME the normal way, but switch to software rendering of OPENGL. You should still be able to use transparency.
opengl('software')