19#include <Common/assertion.h>
20#include <Common/primitive_type.h>
30namespace ph {
class CoreCookedUnit; }
31namespace ph {
class VisualWorld; }
85 std::size_t layerIndex,
141 std::size_t mergeSize);
147 std::vector<RenderWorker> m_workers;
149 std::atomic_bool m_isUpdating;
150 std::atomic_bool m_isRendering;
187 return m_isUpdating.load(std::memory_order_relaxed);
192 return m_isRendering.load(std::memory_order_relaxed);
Definition CoreCookedUnit.h:19
Meta information for data related to ongoing render operation.
Definition RenderObservationInfo.h:15
Definition RenderProgress.h:12
Definition RenderStats.h:12
virtual RenderStats asyncQueryRenderStats()=0
Get general information of the ongoing rendering process. More information can be provided by the imp...
virtual RenderObservationInfo getObservationInfo() const =0
Get information about available transient outputs of an ongoing render operation. This information wi...
math::TAABB2D< int64 > getCropWindowPx() const
The region to work on. The user may specify a window to confine all operations to this region....
Definition Renderer.h:170
Renderer(Viewport viewport, uint32 numWorkers)
Definition Renderer.cpp:26
virtual void doUpdate(const CoreCookedUnit &cooked, const VisualWorld &world)=0
Perform necessary updates for rendering. No asynchronous operation is allowed during update.
virtual void asyncPeekFrame(std::size_t layerIndex, const Region ®ion, HdrRgbFrame &out_frame)=0
Get the intermediate render result. This method is similar to retrieveFrame(), except that correctnes...
uint32 getRenderHeightPx() const
Definition Renderer.h:165
virtual RenderProgress asyncQueryRenderProgress()=0
Get progress of the ongoing rendering process. Implementation is advised to provide this information ...
const Viewport & getViewport() const
Descriptions regarding dimensions for the rendered frame. Viewport is set on ctor and stayed constant...
Definition Renderer.h:180
bool asyncIsUpdating() const
Definition Renderer.h:185
uint32 getRenderWidthPx() const
Definition Renderer.h:160
virtual std::size_t asyncPollUpdatedRegions(TSpan< RenderRegionStatus > out_regions)=0
Get the rendering regions that have been updated. Status of a region will always transition to ERegio...
math::TAABB2D< int64 > getRenderRegionPx() const
The region that is going to be rendered. The difference between render region and crop window is that...
Definition Renderer.h:175
void setNumWorkers(uint32 numWorkers)
Set number of workers for the renderer.
Definition Renderer.cpp:72
void render()
Start rendering.
Definition Renderer.cpp:56
void update(const CoreCookedUnit &cooked, const VisualWorld &world)
Start updating.
Definition Renderer.cpp:36
uint32 numWorkers() const
Definition Renderer.h:155
virtual void retrieveFrame(std::size_t layerIndex, HdrRgbFrame &out_frame)=0
Get the rendered result.
std::size_t asyncPollMergedUpdatedRegions(TSpan< RenderRegionStatus > out_regions, std::size_t mergeSize)
Get the rendering region that has been updated. This variant polls for combined regions....
Definition Renderer.cpp:83
bool asyncIsRendering() const
Definition Renderer.h:190
virtual void doRender()=0
Perform rendering.
const math::TVector2< uint32 > & getBaseSizePx() const
The full size of this viewport.
Definition Viewport.h:70
const math::TAABB2D< int64 > & getWindowPx() const
The window that limits the viewing area of this viewport.
Definition Viewport.h:75
math::TAABB2D< int64 > getCroppedRegionPx() const
The viewing area of this viewport. The difference between cropped region and window is that cropped r...
Definition Viewport.h:80
A virtual world for image synthesis.
Definition VisualWorld.h:34
T & x()
Definition TVector2.ipp:38
T & y()
Definition TVector2.ipp:44
The root for all renderer implementations.
Definition EEngineProject.h:6
std::span< T, EXTENT > TSpan
A contiguous sequence of objects of type T. Effectively the same as std::span.
Definition TSpan.h:12