Save default format, recover it when exit the scene.
Using "getDefaultPixelFormat" instead of "defaultPixelFormat"