2#ifndef LIBSBX_POST_SELECTION_FILTER_HPP_
3#define LIBSBX_POST_SELECTION_FILTER_HPP_
5#include <libsbx/core/profiler.hpp>
7#include <libsbx/scenes/scenes_module.hpp>
9#include <libsbx/post/filter.hpp>
19 selection_filter(
const std::vector<graphics::attachment_description>& attachments,
const std::filesystem::path& path, std::vector<std::pair<std::string, std::string>>&& attachment_names)
20 :
base{attachments, path},
21 _push_handler{base::pipeline()},
22 _attachment_names{std::move(attachment_names)} { }
27 EASY_BLOCK(
"selection_filter::render");
28 SBX_PROFILE_SCOPE(
"selection_filter::render");
30 auto& scenes_module = core::engine::get_module<scenes::scenes_module>();
31 auto& scene = scenes_module.active_scene();
32 auto& environment = scene.environment();
33 auto& graph = scene.graph();
35 auto& graphics_module = core::engine::get_module<graphics::graphics_module>();
37 auto& pipeline = base::pipeline();
38 auto& descriptor_handler = base::descriptor_handler();
40 pipeline.bind(command_buffer);
43 _push_handler.push(
"thickness", 0.5f);
45 descriptor_handler.push(
"scene", environment.uniform_handler());
50 for (
const auto& [name, attachment] : _attachment_names) {
51 descriptor_handler.push(name, graphics_module.attachment(attachment));
54 if (!descriptor_handler.update(pipeline)) {
58 descriptor_handler.bind_descriptors(command_buffer);
59 _push_handler.bind(command_buffer);
61 command_buffer.draw(3, 1, 0, 0);
68 std::vector<std::pair<std::string, std::string>> _attachment_names;
71 std::string _object_id_image;
72 std::string _linear_depth_image;
Definition: command_buffer.hpp:15
Definition: push_handler.hpp:18
RGBA color value type.
Definition: color.hpp:48
Definition: filter.hpp:19
Definition: selection_filter.hpp:13