From e537a34e95b6fbd4af3549ada139268c6a12823e Mon Sep 17 00:00:00 2001 From: Alexander Gauggel <agauggel@uni-koblenz.de> Date: Mon, 16 Aug 2021 16:02:52 +0200 Subject: [PATCH] [#106] Switch motion vector visualisation sampler from linear to nearest --- projects/indirect_dispatch/src/App.cpp | 8 +++++++- projects/indirect_dispatch/src/App.hpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/projects/indirect_dispatch/src/App.cpp b/projects/indirect_dispatch/src/App.cpp index 16f27932..ab79b761 100644 --- a/projects/indirect_dispatch/src/App.cpp +++ b/projects/indirect_dispatch/src/App.cpp @@ -62,6 +62,12 @@ bool App::initialize() { vkcv::SamplerMipmapMode::LINEAR, vkcv::SamplerAddressMode::CLAMP_TO_EDGE); + m_nearestSampler = m_core.createSampler( + vkcv::SamplerFilterType::NEAREST, + vkcv::SamplerFilterType::NEAREST, + vkcv::SamplerMipmapMode::NEAREST, + vkcv::SamplerAddressMode::CLAMP_TO_EDGE); + m_renderTargets = createRenderTargets(m_core, m_windowWidth, m_windowHeight); const int cameraIndex = m_cameraManager.addCamera(vkcv::camera::ControllerType::PILOT); @@ -331,7 +337,7 @@ void App::run() { motionVectorVisualisationDescriptorWrites.sampledImageWrites = { vkcv::SampledImageDescriptorWrite(0, visualisationInput) }; motionVectorVisualisationDescriptorWrites.samplerWrites = { - vkcv::SamplerDescriptorWrite(1, m_linearSampler) }; + vkcv::SamplerDescriptorWrite(1, m_nearestSampler) }; motionVectorVisualisationDescriptorWrites.storageImageWrites = { vkcv::StorageImageDescriptorWrite(2, m_renderTargets.motionBlurOutput) }; diff --git a/projects/indirect_dispatch/src/App.hpp b/projects/indirect_dispatch/src/App.hpp index 5f4fd7eb..ea8a0415 100644 --- a/projects/indirect_dispatch/src/App.hpp +++ b/projects/indirect_dispatch/src/App.hpp @@ -34,4 +34,5 @@ private: RenderTargets m_renderTargets; vkcv::SamplerHandle m_linearSampler; + vkcv::SamplerHandle m_nearestSampler; }; \ No newline at end of file -- GitLab