6#include "core/reflect.h"
8#include "resource/asset/mesh_asset.h"
9#include "resource/asset/material_asset.h"
10#include "system/render/render_backend.h"
12namespace Vkm::Engine {
19enum class PreviewBackground : uint8_t {
36 MaterialHandle material;
38 float pitchDeg = 20.0f;
40 PreviewBackground background = PreviewBackground::Dark;
50using GpuTextureId = uint64_t;
60class EditorRenderHooks {
62 EditorRenderHooks() =
default;
63 virtual ~EditorRenderHooks() =
default;
65 EditorRenderHooks(
const EditorRenderHooks& other) =
delete;
66 EditorRenderHooks& operator=(
const EditorRenderHooks& other) =
delete;
68 EditorRenderHooks(EditorRenderHooks && other) =
delete;
69 EditorRenderHooks& operator=(EditorRenderHooks && other) =
delete;
115 virtual GpuTextureId
textureId(
const TextureHandle& handle)
const = 0;
154VKM_ENUM_NAMES(::Vkm::Engine::PreviewBackground,
"Dark",
"Grey",
"Sky")
What a backend may offer an authoring tool beyond drawing the frame.
Definition editor_render_hooks.h:60
virtual void releaseAllPreviews()=0
Drop every cached preview target.
virtual GpuTextureId previewTexture(uint64_t key) const =0
The texture last rendered for key, without rendering one.
virtual GpuTextureId ensureTexture(const TextureHandle &handle, const ResourceManager &resources)=0
Mirror handle onto the GPU if it is not already, and return it.
virtual GpuTextureId textureId(const TextureHandle &handle) const =0
GPU texture id already mirrored for handle, or 0 if none is.
virtual GpuTextureId chromeImage(const std::string &path)=0
Upload an image the engine owns and return its texture id.
virtual void releasePreview(uint64_t key)=0
Drop the cached target held for key.
virtual GpuTextureId renderPreview(const PreviewRequest &request, const ResourceManager &resources)=0
Draw request offscreen and return the texture to display.
The frame's seam between the engine and the graphics API.
Definition render_backend.h:35
virtual EditorRenderHooks * editorHooks()
The backend's authoring-only hooks, or null when it offers none.
Definition render_backend.h:123
Open type-erased resource registry with typed handles and generational lifetimes.
Definition resource_manager.h:46
One editor preview: a mesh with a material under a studio rig, from an orbit camera.
Definition editor_render_hooks.h:32
float distance
In mesh bounding radii.
Definition editor_render_hooks.h:39
uint32_t size
Square edge, pixels.
Definition editor_render_hooks.h:34
float lightYawDeg
Studio rig rotation around Y.
Definition editor_render_hooks.h:41
uint64_t key
Identifies the cached target.
Definition editor_render_hooks.h:33