Skip to content
Snippets Groups Projects

Resolve "Indirect Dispatch"

Merged Ghost User requested to merge 106-indirect-dispatch into develop
2 files
+ 10
3
Compare changes
  • Side-by-side
  • Inline
Files
2
  • a82d4018
    [#106] Reduce motion blur artifacts when using mouse at high fraerate · a82d4018
    Alexander Gauggel authored
@@ -290,7 +290,14 @@ void App::run() {
const float microsecondToSecond = 0.000001;
const float fDeltatimeSeconds = microsecondToSecond * std::chrono::duration_cast<std::chrono::microseconds>(frameEndTime - frameStartTime).count();
const float motionBlurMotionFactor = 1 / (fDeltatimeSeconds * cameraShutterSpeedInverse);
// small mouse movements are restricted to pixel level and therefore quite unprecise
// therefore extrapolating movement at high framerates results in big jerky movements
// this results in wide sudden motion blur, which looks quite bad
// as a workaround the time scale is limited to a maximum value
const float motionBlurTimeScaleMax = 1.f / 60;
const float deltaTimeMotionBlur = std::max(fDeltatimeSeconds, motionBlurTimeScaleMax);
const float motionBlurMotionFactor = 1 / (deltaTimeMotionBlur * cameraShutterSpeedInverse);
vkcv::PushConstants motionBlurPushConstants(sizeof(float) * 2);
Loading