code for lightpainting torch.