class RendererExtension

Interface that can be implemented in order to provide custom rendering code to the renderer.

See Renderer::addPlugin().

Public

Methods

Initialize

virtual void Initialize(const Any &data)

Called when the renderer extension is first initialized.

Destroy

virtual void Destroy()

Called just before the renderer extension is destroyed.

Check

virtual RendererExtensionRequest Check(const render::Camera &camera) = 0

Returns true if the render() method should be called for the provided camera.

Render

virtual void Render(const render::Camera &camera, const render::RendererViewContext &viewContext) = 0

Called at the point at which rendering should be performed for the provided camera.

Relevant render targets are guaranteed to be already bound to the render API, depending on the RenderLocation. Note that actual structure of the render targets depends on the active renderer.

camera
Camera through which the renderer is currently rendering.
viewContext
Additional information about the currently rendered view.

GetPriority

u32 GetPriority() const

Determines when will the render() method execute, compared to other plugins using the same RenderLocation.

Higher number means the extension will execute before extensions with lower numbers. Priorities only matter for extensions that share the same RenderLocation.

GetLocation

RenderLocation GetLocation() const

Returns a location that determines at which point in rendering should the system call the render() method.

Protected

Constructors

RendererExtension

RendererExtension(RenderLocation location, u32 priority)

Methods

~RendererExtension

virtual ~RendererExtension() noexcept = default

Private

Methods

staticQueueInitializeOnRenderThread

static void QueueInitializeOnRenderThread(RendererExtension *extension, const Any &data, const SPtr<RendererScene> &scene)

Initializer that triggers when a renderer extension is first constructed.

staticQueueDeleteOnRenderThread

static void QueueDeleteOnRenderThread(RendererExtension *extension)

Deleter that triggers when a renderer extension object goes out of scope.

Fields

mLocation

RenderLocation mLocation

mPriority

u32 mPriority

mAssociatedScene

WeakSPtr<render::RendererScene> mAssociatedScene