[Resolved] optixPathTracer undesired fading between frames despite camera movement

I can see that as well when making the optixPathTracer fullscreen and zooming in to make it slower.
Then it’s best seen when dollying in and out (RMB drag) which results in some visual fading effect for a short period of time.

The problem is that frame_number is not reset at the correct location when camera_changed == true.
The fix is simple. Just move two lines of code in updateCamera().

if( camera_changed ) // reset accumulation // FIX: Reset frame_number before setting the OptiX variable.
        frame_number = 1;

    context[ "frame_number" ]->setUint( frame_number++ );
    context[ "eye"]->setFloat( camera_eye );
    context[ "U"  ]->setFloat( camera_u );
    context[ "V"  ]->setFloat( camera_v );
    context[ "W"  ]->setFloat( camera_w );

    // if( camera_changed ) // reset accumulation // BUG: Too late!
    //    frame_number = 1;
    camera_changed = false;