add 3d rgb optimization