SpiecsEngine
 
Loading...
Searching...
No Matches

◆ OnDraw()

void Spices::MeshPack::OnDraw ( const VkCommandBuffer & commandBuffer) const
inherited

Draw indexed.

Parameters
[in]commandBufferWhich command buffer we will submit commands.

Definition at line 96 of file MeshPack.cpp.

97 {
99
100 int lodLevel = 0;
101 const auto ptr = m_Material->GetConstantParams().find_value("lod");
102 if (ptr)
103 {
104 lodLevel = std::any_cast<int>(ptr->value.paramValue);
105 lodLevel = std::max(lodLevel, 0);
106 lodLevel = std::min(lodLevel, (int)m_MeshResource.lods.attributes->size() - 1);
107 }
108 const Lod& lod0 = (*m_MeshResource.lods.attributes)[lodLevel];
109 vkCmdDrawIndexed(commandBuffer, lod0.nPrimitives * 3, 1, lod0.primVertexOffset * 3, 0, 0);
110 }
#define SPICES_PROFILE_ZONE
MeshResource m_MeshResource
Mesh Resources.
Definition MeshPack.h:331
std::shared_ptr< Material > m_Material
specific material pointer.
Definition MeshPack.h:341
std::shared_ptr< std::vector< T > > attributes
Attribute Data Array.
Definition Attribute.h:49