CMiriGraphicsWorldWidgetRenderer
Renders an Miri widget tree into an offscreen engine texture so the scene renderer can draw it as a real in-world quad (nameplates, ping markers). It reuses Miri's own CMiriRenderer against the bridge-adopted device — it is not a second UI renderer, just a second target — and records into the engine's current command buffer through the RHI facade, one small render pass per widget. Each widget keeps its own resolution-sized target and is only re-rendered when the screen stack marks it dirty (content changed or the distance LOD bucket moved), so an idle nameplate costs nothing per frame.
- Module
- MiriGraphics
- Header
#include "MiriGraphics/CMiriGraphicsWorldWidgetRenderer.h"- Namespace
Mowo
The offscreen pass runs under the engine's negative-height (Vulkan Y-flip) viewport, so the produced texture is vertically mirrored relative to the UI; the world-widget quad shader reads it back with a matching V so it lands right-side-up. Colours are written in the overlay's BGRA8 space.
Constructors
| Signature | Name | Description |
|---|---|---|
CMiriGraphicsWorldWidgetRenderer() | CMiriGraphicsWorldWidgetRenderer | |
~CMiriGraphicsWorldWidgetRenderer() | ~CMiriGraphicsWorldWidgetRenderer | |
CMiriGraphicsWorldWidgetRenderer(const CMiriGraphicsWorldWidgetRenderer&) = dele… | CMiriGraphicsWorldWidgetRenderer |
Public functions
| Returns | Name | Description |
|---|---|---|
CMiriGraphicsWorldWidgetRenderer& | operator= | |
bool | IsAvailable | True once the bridge device is up and Miri's offscreen pipelines built. |
bool | EnsureRenderer | |
uint32_t | RecordPending | |
void | SetUpright | The target's image is read as an ordinary texture (a thumbnail, a UI panel) instead of by the world-widget quad shader, which expects the pass's vertical mirroring and undoes it. |
void | SetCustomTimeOverride | |
void | ClearCustomTimeOverride | |
Ref<Image2D> | RenderWidget | Renders widget into owner's cached target at width x height and returns the target's colour image for the scene renderer to sample. |
void | Release | Drops the cached target for an owner that is no longer visible. |
void | Clear | Drops every cached target (device teardown / world change). |
Function details
CMiriGraphicsWorldWidgetRenderer
CMiriGraphicsWorldWidgetRenderer()~CMiriGraphicsWorldWidgetRenderer
~CMiriGraphicsWorldWidgetRenderer()CMiriGraphicsWorldWidgetRenderer
CMiriGraphicsWorldWidgetRenderer(const CMiriGraphicsWorldWidgetRenderer&) = deleteoperator=
CMiriGraphicsWorldWidgetRenderer& operator=(const CMiriGraphicsWorldWidgetRenderer&) = deleteIsAvailable
bool IsAvailable() constTrue once the bridge device is up and Miri's offscreen pipelines built. Everything no-ops (returning null textures) until it is — the screen stack then keeps the widget on the screen-space fallback.
EnsureRenderer
bool EnsureRenderer()RecordPending
uint32_t RecordPending()SetUpright
void SetUpright(bool upright)The target's image is read as an ordinary texture (a thumbnail, a UI panel) instead of by the world-widget quad shader, which expects the pass's vertical mirroring and undoes it. Set before the first render.
SetCustomTimeOverride
void SetCustomTimeOverride(float seconds)ClearCustomTimeOverride
void ClearCustomTimeOverride()RenderWidget
Ref<Image2D> RenderWidget(uint64_t owner, const Miri::TSharedPtr<Miri::MWidget>& widget, uint32_t width, uint32_t height, bool forceRedraw, float contentScale = 1.0f)Renders widget into owner's cached target at width x height and returns the target's colour image for the scene renderer to sample. Returns the existing image (no GPU work) when width/height match the cached target and forceRedraw is false. Returns null when unavailable. contentScale is the paint scale: the widget lays out at width/contentScale x height/contentScale logical units, so a 1920x1080 screen drawn into a 256 px tile is laid out at its design size and scaled down, not squeezed into 256x144 units where its children fall off or overlap.
Release
void Release(uint64_t owner)Drops the cached target for an owner that is no longer visible.
Clear
void Clear()Drops every cached target (device teardown / world change).