hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/rendering/render_path.h
blob: af70fa60ac188fca6c503cbf95a1a5401e2c490d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once

#include "rhi.h"
#include "view.h"
#include "scene_renderer.h"
#include "black_hole_renderer.h"
#include "export_config.h"
#include "core/memory.h"

#include <string>

namespace Donut
{
    class Scene;

    class RenderPath
    {
    public:
        auto init(RHI::Device& device, const std::string& hdri_path) -> bool;
        auto shutdown() -> void;

        auto sync_hdri(const std::string& hdri_path) -> void;

        auto render(RHI::CommandList& cmd, Scene& scene, View view,
                    int fb_width, int fb_height, bool moving, float time) -> void;

        auto export_frame(Scene& scene, const ExportConfig& cfg) -> int;

    private:
        RHI::Device*             m_device = nullptr;
        Scope<SceneRenderer>     m_scene_renderer;
        Scope<BlackHoleRenderer> m_black_hole_renderer;
        Ref<RHI::Texture>        m_cubemap;
        std::string              m_hdri_path;
    };
}