split the renderer in 2d and 3d