Some work on OpenGL 3.1 renderer, unfinished.