nvpro-samples / optix_advanced_samples

426 stars 87 forks source link

Frame count bug in ProgressivePhotonMap #3

Closed bacTlink closed 5 years ago

bacTlink commented 6 years ago
if ( accumulation_frame == 1 ) {

    if (s_print_timings) std::cerr << "Starting RT pass ... ";
    double t0 = sutil::currentTime();

    // Trace viewing rays
    context->launch( rtpass, camera.width(), camera.height() );

    double t1 = sutil::currentTime();
    if (s_print_timings) std::cerr << "finished. " << t1 - t0 << std::endl;

    context["total_emitted"]->setFloat(  0.0f );
}

Counter accumulation_frame in the first invocation of launch_all is 0, while launch_all initialize the viewing rays when accumulation_frame == 1.

for ( unsigned int frame = 0; frame < numframes; ++frame ) {
    context["frame_number"]->setFloat( static_cast<float>( frame++ ) );
    launch_all( camera, photon_launch_dim, frame, photons_buffer, photon_map_buffer );
}

The frame counter here increases twice.

dylanlacewell commented 5 years ago

Yep, this looks like a bug, and we should have fixed it earlier. Thanks for reporting it. Fixed with commit e4b6e03.