added a way to disable the gbuffer (used for 3d) for better performance when doing 2d only
refactoring