Loading...
Searching...
No Matches
score::gfx::Mesh Struct Referenceabstract

Data model for meshes. More...

Inheritance diagram for score::gfx::Mesh:
score::gfx::BasicMesh score::gfx::CustomMesh score::gfx::DummyMesh score::gfx::PlainMesh score::gfx::TexturedMesh score::gfx::PlainTriangle score::gfx::TexturedQuad score::gfx::TexturedTriangle

Detailed Description

Data model for meshes.

Public Types

enum  Flag {
  HasPosition = SCORE_FLAG(1) , HasTexCoord = SCORE_FLAG(2) , HasColor = SCORE_FLAG(3) , HasNormals = SCORE_FLAG(4) ,
  HasTangents = SCORE_FLAG(5)
}
 
using Flags = QFlags< Flag >
 

Public Member Functions

virtual Flags flags () const noexcept=0
 
virtual MeshBuffers init (QRhi &rhi) const noexcept=0
 
virtual void update (QRhi &rhi, MeshBuffers &bufs, QRhiResourceUpdateBatch &cb) const noexcept=0
 
virtual void preparePipeline (QRhiGraphicsPipeline &pip) const noexcept=0
 
virtual void draw (const MeshBuffers &bufs, QRhiCommandBuffer &cb) const noexcept=0
 
virtual const char * defaultVertexShader () const noexcept=0
 A basic vertex shader that is going to work with this mesh.
 
virtual const ossia::geometry * semanticGeometry () const noexcept
 Return the underlying semantic geometry if available.
 
bool hasGeometryChanged (int64_t &renderer) const noexcept
 

Public Attributes

ossia::geometry_filter_list_ptr filters
 
std::atomic_int64_t dirtyGeometryIndex {-1}
 

Member Function Documentation

◆ defaultVertexShader()

virtual const char * score::gfx::Mesh::defaultVertexShader ( ) const
pure virtualnoexcept

A basic vertex shader that is going to work with this mesh.

Implemented in score::gfx::CustomMesh, score::gfx::DummyMesh, score::gfx::PlainMesh, and score::gfx::TexturedMesh.

◆ semanticGeometry()

virtual const ossia::geometry * score::gfx::Mesh::semanticGeometry ( ) const
inlinevirtualnoexcept

Return the underlying semantic geometry if available.

Used by buildPipeline() to remap vertex input layouts by matching shader input variable names to geometry attribute semantics. Meshes that carry semantic information (e.g. CustomMesh) should override this.

Reimplemented in score::gfx::CustomMesh.


The documentation for this struct was generated from the following files: