Photon Editor Library 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
OfflineRenderAgent.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <SDL/sdl_interface.h>
6#include <DataIO/sdl_picture_file_type.h>
7
8namespace ph::editor::render { class OfflineRenderer; }
9
10namespace ph::editor
11{
12
14{
15public:
17
18 RenderConfig getRenderConfig() const override;
19 void render(RenderConfig config) override;
20
21 void renderInit(RenderThreadCaller& caller);
22 void renderUninit(RenderThreadCaller& caller);
23 void update(const MainThreadUpdateContext& ctx);
25
26private:
27 render::OfflineRenderer* m_renderer = nullptr;
28
29 // SDL-binded fields
30 EPictureFile m_outputFileFormat;
31 bool m_useCopiedScene;
32 bool m_enableStatsRequest;
33 bool m_enablePeekingFrame;
34
35public:
36 PH_DEFINE_SDL_CLASS(TSdlOwnerClass<OfflineRenderAgent>)
37 {
38 ClassType clazz("offline-render-agent");
39 clazz.docName("Offline Render Agent");
40 clazz.description("Controls offline rendering.");
41 clazz.baseOn<RenderAgent>();
42
43 TSdlEnumField<OwnerType, EPictureFile> outputFileFormat("output-file-format", &OwnerType::m_outputFileFormat);
44 outputFileFormat.description("File format of the rendered output.");
45 outputFileFormat.defaultTo(EPictureFile::PNG);
46 clazz.addField(outputFileFormat);
47
48 TSdlBool<OwnerType> useCopiedScene("use-copied-scene", &OwnerType::m_useCopiedScene);
49 useCopiedScene.description(
50 "Whether to use a copied scene for rendering.");
51 useCopiedScene.defaultTo(true);
52 clazz.addField(useCopiedScene);
53
54 TSdlBool<OwnerType> enableStatsRequest("enable-stats-request", &OwnerType::m_enableStatsRequest);
55 enableStatsRequest.description(
56 "Whether to enable the retrieval of rendering statistics.");
57 enableStatsRequest.defaultTo(true);
58 clazz.addField(enableStatsRequest);
59
60 TSdlBool<OwnerType> enablePeekingFrame("enable-peeking-frame", &OwnerType::m_enablePeekingFrame);
61 enablePeekingFrame.description(
62 "Whether to enable the retrieval of intermediate rendering result.");
63 enablePeekingFrame.defaultTo(true);
64 clazz.addField(enablePeekingFrame);
65
66 return clazz;
67 }
68};
69
70}// end namespace ph::editor
Definition MainThreadRenderUpdateContext.h:11
Definition MainThreadUpdateContext.h:11
Definition OfflineRenderAgent.h:14
void render(RenderConfig config) override
Start producing a rendered scene. This method kicks off the rendering process and returns immediately...
Definition OfflineRenderAgent.cpp:36
void update(const MainThreadUpdateContext &ctx)
Definition OfflineRenderAgent.cpp:87
void renderUninit(RenderThreadCaller &caller)
Definition OfflineRenderAgent.cpp:73
void renderInit(RenderThreadCaller &caller)
Definition OfflineRenderAgent.cpp:56
PH_DEFINE_SDL_CLASS(TSdlOwnerClass< OfflineRenderAgent >)
Definition OfflineRenderAgent.h:36
RenderConfig getRenderConfig() const override
Definition OfflineRenderAgent.cpp:20
void renderUpdate(const MainThreadRenderUpdateContext &ctx)
Definition OfflineRenderAgent.cpp:92
Definition RenderAgent.h:16
Definition RenderConfig.h:13
Thin wrapper for render thread interactions from another thread. Mainly to hide unrelated render thre...
Definition RenderThreadCaller.h:16
Definition OfflineRenderer.h:27
Definition DesignerObject.h:19
Definition ph_editor.h:10