Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
Engine.h
Go to the documentation of this file.
1#pragma once
2
3#include "World/VisualWorld.h"
6#include "Math/TVector2.h"
7#include "Frame/frame_fwd.h"
12
13#include <string>
14
15namespace ph
16{
17
20class Engine final
21{
22public:
23 Engine();
24
25 void enterCommand(const std::string& commandFragment);
26 bool loadCommands(const Path& sceneFile);
27 void update();
28 void render();
29
30 void retrieveFrame(
31 std::size_t layerIndex,
32 HdrRgbFrame& out_frame,
33 bool applyPostProcessing = true);
34
36
40 void setNumThreads(uint32 numThreads);
41
42 void asyncPeekFrame(
43 std::size_t layerIndex,
44 const Region& region,
45 HdrRgbFrame& out_frame,
46 bool applyPostProcessing = true) const;
47
48 void asyncQueryStatistics(float32* out_percentageProgress,
49 float32* out_samplesPerSecond) const;
50
51 void setWorkingDirectory(const Path& directory);
52
53 Renderer* getRenderer() const;
54
55private:
56 SdlSceneFileReader m_sceneParser;
57 SceneDescription m_rawScene;
58 VisualWorld m_visualWorld;
59 CoreCookedUnit m_cooked;
60 uint32 m_numThreads;
61
62 //FrameProcessor m_frameProcessor;
63 // TODO: associate each attribute with a pipeline
64 //FrameProcessor::PipelineId m_id;
65};
66
67// In-header Implementations:
68
70{
71 return m_cooked.getRenderer();
72}
73
74}// end namespace ph
Definition CoreCookedUnit.h:19
Renderer * getRenderer() const
Definition CoreCookedUnit.h:56
The render engine.
Definition Engine.h:21
void update()
Definition Engine.cpp:79
void enterCommand(const std::string &commandFragment)
Definition Engine.cpp:43
bool loadCommands(const Path &sceneFile)
Definition Engine.cpp:57
math::TVector2< int64 > getFilmDimensionPx() const
Definition Engine.cpp:185
void setNumThreads(uint32 numThreads)
Control the number of threads used for all engine operations.
Definition Engine.cpp:193
Renderer * getRenderer() const
Definition Engine.h:69
void asyncPeekFrame(std::size_t layerIndex, const Region &region, HdrRgbFrame &out_frame, bool applyPostProcessing=true) const
Definition Engine.cpp:202
void setWorkingDirectory(const Path &directory)
Definition Engine.cpp:231
void asyncQueryStatistics(float32 *out_percentageProgress, float32 *out_samplesPerSecond) const
Definition Engine.cpp:218
void render()
Definition Engine.cpp:152
Engine()
Definition Engine.cpp:29
void retrieveFrame(std::size_t layerIndex, HdrRgbFrame &out_frame, bool applyPostProcessing=true)
Definition Engine.cpp:167
General path representation. Does not check whether the target actually exists (e....
Definition Path.h:21
Definition Renderer.h:39
Data that describe a scene. Represents the result of running SDL commands.
Definition SceneDescription.h:14
Loading utility for renderer scene. Loads .p2 (Photon-v2) file.
Definition SdlSceneFileReader.h:18
A virtual world for image synthesis.
Definition VisualWorld.h:34
Represents a 2-D vector.
Definition TVector2.h:19
The root for all renderer implementations.
Definition EEngineProject.h:6