Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::RenderTypePlugin Class Referenceabstract

#include <RenderTypePlugin.hpp>

Inheritance diagram for esengine::RenderTypePlugin:

Public Member Functions

virtual ~RenderTypePlugin ()=default
virtual void init (RenderFrameContext &ctx)
virtual void shutdown ()
virtual bool castsShadows () const
 Whether what this plugin draws belongs in a shadow map.
virtual bool castInputs (RenderFrameContext &, ecs::Registry &, u64 &)
 For a plugin that casts: one number for everything its depth collect reads apart from the shadow views and the frame's camera, so a frame whose number, views and camera match those of the frame that drew the shadow map need not collect it again.
virtual bool castHeldInputs (u64 &) const
virtual u32 castMoverCount () const
virtual bool drawsMotion () const
virtual bool drawsScreenUI () const
 Whether this plugin can draw an entity that lives in a UI tree.
virtual void collect (RenderCollectContext &ctx)=0
virtual void scheduleSkins (RenderFrameContext &ctx, ecs::Registry &registry, SkinCache &cache)
 Make ready the programs entities will be asked for, drawing none.
virtual RenderPrewarmResult prewarm (RenderFrameContext &ctx, ecs::Registry &registry, const Entity *entities, u32 count, bool shadowPasses)
virtual RenderPrewarmResult prewarmDocument (RenderFrameContext &ctx, const MeshDocumentRecord *rows, u32 count, bool shadowPasses)
 The same readiness, asked of a PREPARED cell's own description.
virtual const char * collectScope () const
 What this plugin's collect is called in a frame profile.
virtual bool clusterInspect (u32, u32 &, u32 &) const
 What the last frames drew of the Cluster LOD mesh of the entity entityId.

Detailed Description

Definition at line 536 of file RenderTypePlugin.hpp.

Constructor & Destructor Documentation

◆ ~RenderTypePlugin()

virtual esengine::RenderTypePlugin::~RenderTypePlugin ( )
virtualdefault

Member Function Documentation

◆ castHeldInputs()

virtual bool esengine::RenderTypePlugin::castHeldInputs ( u64 & ) const
inlinevirtual

Reimplemented in esengine::MeshPlugin.

Definition at line 560 of file RenderTypePlugin.hpp.

◆ castInputs()

virtual bool esengine::RenderTypePlugin::castInputs ( RenderFrameContext & ,
ecs::Registry & ,
u64 &  )
inlinevirtual

For a plugin that casts: one number for everything its depth collect reads apart from the shadow views and the frame's camera, so a frame whose number, views and camera match those of the frame that drew the shadow map need not collect it again.

Returns
False when it cannot vouch for what it would read (the frame then collects). Asked once a frame, before the shadow collect; a plugin may keep what it needs between calls.

Reimplemented in esengine::MeshPlugin.

Definition at line 559 of file RenderTypePlugin.hpp.

◆ castMoverCount()

virtual u32 esengine::RenderTypePlugin::castMoverCount ( ) const
inlinevirtual

Reimplemented in esengine::MeshPlugin.

Definition at line 561 of file RenderTypePlugin.hpp.

◆ castsShadows()

virtual bool esengine::RenderTypePlugin::castsShadows ( ) const
inlinevirtual

Whether what this plugin draws belongs in a shadow map.

A map holds depth written from the light, and only geometry drawn through the depth-only variant writes any. Anything else reaches the atlas as COLOUR, which every receiver then reads back as a depth — so the default is no, and a plugin that casts says so.

Reimplemented in esengine::MeshPlugin.

Definition at line 551 of file RenderTypePlugin.hpp.

◆ clusterInspect()

virtual bool esengine::RenderTypePlugin::clusterInspect ( u32 ,
u32 & ,
u32 &  ) const
inlinevirtual

What the last frames drew of the Cluster LOD mesh of the entity entityId.

Its triangles and its clusters, as the cut picked for the scene view; false from a plugin that draws no such mesh, and for an entity it has not drawn lately. The editor's selection readout says it beside the mesh's own count, which a clustered mesh does not draw.

Reimplemented in esengine::MeshPlugin.

Definition at line 629 of file RenderTypePlugin.hpp.

◆ collect()

◆ collectScope()

virtual const char * esengine::RenderTypePlugin::collectScope ( ) const
inlinevirtual

What this plugin's collect is called in a frame profile.

A literal: the profiler keys scopes by content and keeps the pointer. A type that does not answer is reported as other rather than folded into a neighbour, whose cost it would become.

Reimplemented in esengine::MeshPlugin, esengine::ParticlePlugin, esengine::ShapePlugin, esengine::SpritePlugin, esengine::TextPlugin, esengine::TilemapRenderPlugin, esengine::TrailPlugin, and esengine::UIElementPlugin.

Definition at line 620 of file RenderTypePlugin.hpp.

◆ drawsMotion()

virtual bool esengine::RenderTypePlugin::drawsMotion ( ) const
inlinevirtual

Whether the Motion collect asks this plugin: what it draws can move by itself, and the picture after it needs to know by how much.

Reimplemented in esengine::MeshPlugin.

Definition at line 564 of file RenderTypePlugin.hpp.

◆ drawsScreenUI()

virtual bool esengine::RenderTypePlugin::drawsScreenUI ( ) const
inlinevirtual

Whether this plugin can draw an entity that lives in a UI tree.

The overlay collect runs only these. Saying yes is a promise to consult RenderCollectContext::accepts, without which the plugin draws the screen's entities in the world's pass too.

Reimplemented in esengine::ParticlePlugin, esengine::SpritePlugin, and esengine::UIElementPlugin.

Definition at line 573 of file RenderTypePlugin.hpp.

◆ init()

virtual void esengine::RenderTypePlugin::init ( RenderFrameContext & ctx)
inlinevirtual

◆ prewarm()

virtual RenderPrewarmResult esengine::RenderTypePlugin::prewarm ( RenderFrameContext & ctx,
ecs::Registry & registry,
const Entity * entities,
u32 count,
bool shadowPasses )
inlinevirtual

Reimplemented in esengine::MeshPlugin.

Definition at line 593 of file RenderTypePlugin.hpp.

References esengine::ctx().

◆ prewarmDocument()

virtual RenderPrewarmResult esengine::RenderTypePlugin::prewarmDocument ( RenderFrameContext & ctx,
const MeshDocumentRecord * rows,
u32 count,
bool shadowPasses )
inlinevirtual

The same readiness, asked of a PREPARED cell's own description.

The second fact source. What it derives must equal what prewarm derives from the live entities, which is a claim a criterion holds rather than a comment.

Reimplemented in esengine::MeshPlugin.

Definition at line 606 of file RenderTypePlugin.hpp.

References esengine::ctx().

◆ scheduleSkins()

virtual void esengine::RenderTypePlugin::scheduleSkins ( RenderFrameContext & ctx,
ecs::Registry & registry,
SkinCache & cache )
inlinevirtual

Make ready the programs entities will be asked for, drawing none.

What it readies is derived by the SAME rule the collect derives it by, so a caller cannot ready a variant the draw will not ask for. shadowPasses says whether this scene also renders depth, which needs its own variant. The default readies nothing.

Puts this type's skinned renderables that go through the skin cache into this frame's schedule: once a frame, before any view collects, so every pass of the frame draws what one dispatch posed. The default has none.

Definition at line 589 of file RenderTypePlugin.hpp.

References esengine::ctx().

◆ shutdown()

virtual void esengine::RenderTypePlugin::shutdown ( )
inlinevirtual

The documentation for this class was generated from the following file: