![]() |
Castor3D 0.12.0
Multiplatform 3D engine
|
#include <InstantiationComponent.hpp>


Classes | |
| struct | Data |
Public Types | |
| using | InstanceDataMap = std::map< MaterialRPtr, Data > |
Public Member Functions | |
| C3D_API | InstantiationComponent (Submesh &submesh, uint32_t threshold=1u) |
| Constructor. More... | |
| C3D_API uint32_t | ref (MaterialRPtr material) |
| Increments instance count. More... | |
| C3D_API uint32_t | unref (MaterialRPtr material) |
| Decrements instance count. More... | |
| C3D_API uint32_t | getRefCount (MaterialRPtr material) const |
| Retrieves the instances count. More... | |
| C3D_API bool | isInstanced (MaterialRPtr material) const |
| C3D_API bool | isInstanced () const |
| C3D_API uint32_t | getMaxRefCount () const |
| C3D_API void | gather (ShaderFlags const &shaderFlags, ProgramFlags const &programFlags, MaterialRPtr material, ashes::BufferCRefArray &buffers, std::vector< uint64_t > &offsets, ashes::PipelineVertexInputStateCreateInfoCRefArray &layouts, TextureFlagsArray const &mask, uint32_t ¤tLocation) override |
| Gathers buffers that need to go in a vertex layout. More... | |
| C3D_API SubmeshComponentSPtr | clone (Submesh &submesh) const override |
| C3D_API ProgramFlags | getProgramFlags (MaterialRPtr material) const override |
| uint32_t | getThreshold () const |
| InstanceDataMap::const_iterator | end () const |
| InstanceDataMap::iterator | end () |
| InstanceDataMap::const_iterator | find (MaterialRPtr material) const |
| InstanceDataMap::iterator | find (MaterialRPtr material) |
Public Member Functions inherited from castor3d::SubmeshComponent | |
| C3D_API | SubmeshComponent (Submesh &submesh, castor::String const &type, uint32_t id) |
| Constructor. More... | |
| virtual C3D_API | ~SubmeshComponent () noexcept=default |
| Destructor. More... | |
| C3D_API bool | initialise (RenderDevice const &device) |
| Initialises the submesh. More... | |
| C3D_API void | cleanup (RenderDevice const &device) |
| Cleans the submesh. More... | |
| C3D_API void | upload () |
| Uploads data on VRAM. More... | |
| virtual C3D_API void | gather (ShaderFlags const &shaderFlags, ProgramFlags const &programFlags, MaterialRPtr material, ashes::BufferCRefArray &buffers, std::vector< uint64_t > &offsets, ashes::PipelineVertexInputStateCreateInfoCRefArray &layouts, TextureFlagsArray const &mask, uint32_t ¤tLocation)=0 |
| Gathers buffers that need to go in a vertex layout. More... | |
| virtual C3D_API ProgramFlags | getProgramFlags (MaterialRPtr material) const =0 |
| virtual C3D_API VkBufferUsageFlags | getUsageFlags () const |
| virtual C3D_API SubmeshComponentSPtr | clone (Submesh &submesh) const =0 |
| castor::String const & | getType () const |
| void | needsUpdate () |
| Sets the component to be updated. More... | |
| uint32_t | getID () |
Static Public Attributes | |
| static C3D_API castor::String const | Name |
| static C3D_API uint32_t constexpr | BindingPoint = 2u |
| using castor3d::InstantiationComponent::InstanceDataMap = std::map< MaterialRPtr, Data > |
|
explicit |
Constructor.
| [in] | submesh | The parent submesh. |
| [in] | threshold | The threshold from which a submesh will be instantiated. |
|
overridevirtual |
| [in,out] | submesh | Receives the cloned component. |
Implements castor3d::SubmeshComponent.
|
inline |
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Gathers buffers that need to go in a vertex layout.
| [in] | shaderFlags | The shader flags. |
| [in] | programFlags | The program flags. |
| [in] | material | The material. |
| [in,out] | buffers | Receives the buffers. |
| [in,out] | offsets | Receives the buffers offsets. |
| [in,out] | layouts | Receives the vertex layouts. |
| [in] | mask | The textures mask. |
| [in,out] | currentLocation | The current attribute location. |
Implements castor3d::SubmeshComponent.
| C3D_API uint32_t castor3d::InstantiationComponent::getMaxRefCount | ( | ) | const |
|
overridevirtual |
name Getters.
Implements castor3d::SubmeshComponent.
| C3D_API uint32_t castor3d::InstantiationComponent::getRefCount | ( | MaterialRPtr | material | ) | const |
Retrieves the instances count.
| [in] | material | The material for which the instance count is retrieved |
|
inline |
| C3D_API bool castor3d::InstantiationComponent::isInstanced | ( | ) | const |
true if the max instance count is greater than the threshold. | C3D_API bool castor3d::InstantiationComponent::isInstanced | ( | MaterialRPtr | material | ) | const |
| [in] | material | The material. |
true if the instance count for given material is greater than the threshold. | C3D_API uint32_t castor3d::InstantiationComponent::ref | ( | MaterialRPtr | material | ) |
Increments instance count.
| [in] | material | The material for which the instance count is incremented. |
| C3D_API uint32_t castor3d::InstantiationComponent::unref | ( | MaterialRPtr | material | ) |
Decrements instance count.
| [in] | material | The material for which the instance count is decremented. |
|
staticconstexpr |
|
static |