void LightTracer::render(const ScenePtr& scene) {
    // where the light tracing actual work happen...
    // skip the above meaty tasks codes
    
    uint64_t totalSampleCount = 0;
    for (size_t i = 0; i < tiles.size(); ++i) {
        totalSampleCount += tiles[i]->getTotalSampleCount();
    }
    film->mergeTiles();
    // normalize the film in the unbiased filter way
    film->scaleImage(film->getFilmArea() / totalSampleCount);
    // since we already done the normalization above
    // set the normalization flag to false
    film->writeImage(false);
}