|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Buffers, the layout that describes them, and the bounds culling reads. More...
#include <Mesh.hpp>
Public Member Functions | |
| bool | hasEdges () const |
| bool | isSkinned () const |
| bool | isMorphable () const |
| bool | isChunked () const |
| bool | hasRealization () const |
| bool | isDrawable () const |
Buffers, the layout that describes them, and the bounds culling reads.
One record because the three are inseparable: a buffer without its layout cannot be drawn, and bounds kept elsewhere go stale. Where the geometry comes back from after a device loss is the minting producer's to declare — tools/meshProducers.mjs.
|
inline |
Whether the edges can be drawn.
Definition at line 118 of file Mesh.hpp.
References edgeIndexBuffer, edgeIndexCount, and esengine::Invalid.
Referenced by esengine::MeshPlugin::collect().
|
inline |
Whether GPU buffers stand behind this identity.
Definition at line 192 of file Mesh.hpp.
References indexBuffer, esengine::Invalid, layout, and vertexBuffer.
Referenced by isDrawable(), and esengine::resource::ResourceManager::meshRealizations().
|
inline |
Definition at line 186 of file Mesh.hpp.
References skinChunks.
Referenced by esengine::MeshPlugin::collect().
|
inline |
Definition at line 199 of file Mesh.hpp.
References hasRealization(), and indexCount.
Referenced by esengine::MeshPlugin::collect(), esengine::gatherLodLevels(), and esengine::placementCoarseMesh().
|
inline |
Definition at line 162 of file Mesh.hpp.
References esengine::Invalid, morphTargetCount, and morphTexture.
Referenced by esengine::SkinCache::schedule().
|
inline |
Definition at line 150 of file Mesh.hpp.
References inverseBind.
Referenced by esengine::gatherLodLevels(), and esengine::resource::ResourceManager::setMeshSkinChunks().
| u32 esengine::Mesh::arenaFirstVertex = 0 |
Definition at line 105 of file Mesh.hpp.
Referenced by esengine::resource::ResourceManager::releaseMesh().
| u32 esengine::Mesh::arenaPage = 0 |
The page and first vertex of that place, to give it back: page 0 is buffers of the mesh's own.
Definition at line 104 of file Mesh.hpp.
Referenced by esengine::resource::ResourceManager::releaseMesh().
| std::shared_ptr<const lod::ClusterHierarchy> esengine::Mesh::clusters |
The mesh at every level of detail, as clusters a view picks from (ClusterSelection.hpp). Null for a mesh drawn whole. indexBuffer holds level 0, the mesh's own triangles, so whatever knows nothing of clusters draws it as it always was. Given after the geometry is realized and dropped when it is realized again: the indices in it name these vertices.
Definition at line 171 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and esengine::resource::ResourceManager::setMeshClusters().
| BufferHandle esengine::Mesh::edgeIndexBuffer = BufferHandle::Invalid |
Definition at line 114 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and hasEdges().
| u32 esengine::Mesh::edgeIndexCount = 0 |
Definition at line 115 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and hasEdges().
| resource::IndexBufferHandle esengine::Mesh::edges |
The mesh's own edges as line-list indices into the same vertices, one pair per distinct edge. Derived from indices when the mesh is realized, and only while the manager is asked for diagnostic geometry (an editor's wireframe view): a shipped game spends nothing on it. Invalid otherwise.
Definition at line 113 of file Mesh.hpp.
Referenced by esengine::resource::ResourceManager::releaseMesh().
| u32 esengine::Mesh::firstIndex = 0 |
Where this mesh's first index sits in indexBuffer: past zero when the mesh shares a page with others of its vertex shape (MeshArena), whose buffers and layout it then draws through. Its indices are rebased onto the page's vertices, so a draw reads indexCount of them from here and needs nothing else to find its own.
Definition at line 102 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and esengine::resource::ResourceManager::releaseMesh().
| bool esengine::Mesh::hasLightmapUV = false |
Whether the vertices carry a second UV set — the one a bake is read through. Beside hasNormals and for the same reason: an optional channel the geometry owns decides the record's shape and the variant.
Definition at line 132 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and esengine::placementCoarseMesh().
| bool esengine::Mesh::hasNormals = false |
Whether the vertices carry normals — decides the per-object record's shape and which shader variant draws it.
Definition at line 127 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and esengine::placementCoarseMesh().
| bool esengine::Mesh::hasTangents = false |
Whether the vertices carry a tangent (xyz along +u, w the bitangent's handedness) beside the normal — the frame a normal map was baked in. Without one the fragment derives a frame from screen-space derivatives.
Definition at line 136 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and esengine::placementCoarseMesh().
| BufferHandle esengine::Mesh::indexBuffer = BufferHandle::Invalid |
Definition at line 92 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and hasRealization().
| u32 esengine::Mesh::indexCount = 0 |
Definition at line 95 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), isDrawable(), esengine::resource::ResourceManager::releaseMesh(), and esengine::resource::ResourceManager::setMeshSkinChunks().
| resource::IndexBufferHandle esengine::Mesh::indices |
Definition at line 88 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and esengine::resource::ResourceManager::releaseMesh().
| std::vector<glm::mat4> esengine::Mesh::inverseBind |
The bind pose, one per joint the Joints channel indexes. Empty for geometry nothing skins; its size is what a skinned draw allocates.
Definition at line 148 of file Mesh.hpp.
Referenced by esengine::gatherLodLevels(), isSkinned(), and esengine::resource::ResourceManager::setMeshSkinChunks().
| VertexLayoutHandle esengine::Mesh::layout = VertexLayoutHandle::Invalid |
Definition at line 93 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), hasRealization(), and esengine::resource::ResourceManager::releaseMesh().
| glm::vec3 esengine::Mesh::localMax {0.0f, 0.0f, 0.0f} |
Definition at line 144 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), esengine::gatherLodLevels(), esengine::meshLocalBounds(), and esengine::renderer_renderMaterialPreview().
| glm::vec3 esengine::Mesh::localMin {0.0f, 0.0f, 0.0f} |
Local-space bounds of the vertices, for the frustum cull.
Definition at line 143 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), esengine::gatherLodLevels(), esengine::meshLocalBounds(), and esengine::renderer_renderMaterialPreview().
| u32 esengine::Mesh::morphTargetCount = 0 |
Definition at line 156 of file Mesh.hpp.
Referenced by isMorphable().
| TextureHandle esengine::Mesh::morphTexture = TextureHandle::Invalid |
The shapes this geometry can be blended towards, as a texture of deltas: one texel per (target, vertex), and a second behind it where the targets bend normals. Realized with the buffers above and lost with them.
Definition at line 155 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), isMorphable(), and esengine::resource::ResourceManager::releaseMesh().
| MeshRecovery esengine::Mesh::recovery = MeshRecovery::HostOnly |
Set at mint by the producer that created this mesh; never inferred later. Defaulted to the answer that promises nothing, so a mesh reaching the pool without one is never mistaken for recoverable.
Definition at line 123 of file Mesh.hpp.
Referenced by esengine::resource::ResourceManager::createMesh(), and esengine::resource::ResourceManager::rematerializeMesh().
| u64 esengine::Mesh::revision = 0 |
Changes whenever this mesh's geometry does (it is realized again: a reload, a recovery): see core/Revision.hpp.
Definition at line 189 of file Mesh.hpp.
Referenced by esengine::SkinCache::schedule(), esengine::resource::ResourceManager::setMeshClusters(), and esengine::resource::ResourceManager::setMeshSkinChunks().
| std::vector<u16> esengine::Mesh::skinChunkBones |
Definition at line 185 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and esengine::resource::ResourceManager::setMeshSkinChunks().
| std::vector<MeshSkinChunk> esengine::Mesh::skinChunks |
The chunks a skin of more bones than one draw carries is drawn in, one draw each; empty for a mesh drawn in one. Given after the geometry is realized and dropped when it is realized again, like the clusters: its runs name these indices and its bones these bind matrices.
Definition at line 178 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), isChunked(), and esengine::resource::ResourceManager::setMeshSkinChunks().
| std::shared_ptr<const std::vector<u32> > esengine::Mesh::skinIndices |
| MeshSkinLayout esengine::Mesh::skinLayout |
Definition at line 184 of file Mesh.hpp.
Referenced by esengine::SkinCache::schedule().
| std::shared_ptr<const std::vector<u8> > esengine::Mesh::skinSource |
A skinned mesh's vertices as uploaded, which the skin cache skins into a copy of its own each frame; with where its channels sit. Null for a mesh nothing skins. Shared, so a cache entry holds it past a reload of the mesh.
Definition at line 181 of file Mesh.hpp.
Referenced by esengine::SkinCache::schedule().
| f32 esengine::Mesh::uvDensity = 0.0f |
UV units per world unit of the mesh's own surface (see MeshUvDensity.hpp): what a view asks a texture's size by. 0 without float positions and a float first UV set.
Definition at line 140 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect().
| BufferHandle esengine::Mesh::vertexBuffer = BufferHandle::Invalid |
GPU-side handles, cached so a draw does not walk two pools per frame.
Definition at line 91 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and hasRealization().
| u32 esengine::Mesh::vertexCount = 0 |
Vertices the deltas are indexed by — the stride from one target to the next inside the texture, and the reason it is kept beside them.
Definition at line 160 of file Mesh.hpp.
Referenced by esengine::resource::ResourceManager::releaseMesh(), esengine::SkinCache::schedule(), and esengine::resource::ResourceManager::setMeshClusters().
| resource::VertexBufferHandle esengine::Mesh::vertices |
Definition at line 87 of file Mesh.hpp.
Referenced by esengine::MeshPlugin::collect(), and esengine::resource::ResourceManager::releaseMesh().