|
evan 2026.1.4
Evan
|
#include <headers/evan/GPUVertex.hpp>
Public Member Functions | |
| bool | operator== (const GPUVertex &other) const |
| Equality operator for GPUVertex. | |
Static Public Member Functions | |
| static VkVertexInputBindingDescription | getBindingDescription () |
| Get the binding description for the vertex. | |
| static std::array< VkVertexInputAttributeDescription, 3 > | getAttributeDescriptions () |
| Get the attribute descriptions for the vertex. | |
| static VkVertexInputBindingDescription | getInstanceBindingDescription () |
| Get the binding description for per-instance data. | |
| static std::array< VkVertexInputAttributeDescription, 4 > | getInstanceAttributeDescriptions () |
| Get the attribute descriptions for per-instance data. | |
| static GPUVertex | createFromVertex (const utility::graphic::VertexF &vertex) |
| Create a GPUVertex from a utility::graphic::Vertex object. | |
Public Attributes | |
| glm::vec3 | pos |
| Position of the vertex. | |
| glm::vec3 | color |
| glm::vec2 | texCoord |
| Texture coordinates of the vertex. | |
GPUVertex structure.
This structure represents a vertex in the 3D space. It contains the position, color, and texture coordinates of the vertex. It is used to define the vertex data for rendering.
Definition at line 38 of file GPUVertex.hpp.
|
inlinestatic |
Create a GPUVertex from a utility::graphic::Vertex object.
This static function takes a utility::graphic::Vertex object as input and converts it into a GPUVertex object. It extracts the position, color, and texture coordinates from the Vertex object and maps them to the corresponding attributes of the GPUVertex. The color is converted from a Color32Bit format (with components in the range [0, 255]) to a normalized RGB format (with components in the range [0.0, 1.0]) suitable for use in shaders.
| vertex | The utility::graphic::VertexF object to convert. |
Definition at line 182 of file GPUVertex.hpp.
|
inlinestatic |
Get the attribute descriptions for the vertex.
This function returns an array of attribute descriptions for the vertex, which specify the format and offset of each attribute in the vertex data.
Definition at line 80 of file GPUVertex.hpp.
|
inlinestatic |
Get the binding description for the vertex.
This function returns the binding description for the vertex, which specifies how the vertex data is laid out in memory.
Definition at line 58 of file GPUVertex.hpp.
|
inlinestatic |
Get the attribute descriptions for per-instance data.
The instance model matrix is exposed as four consecutive vec4 attributes (locations 3 to 6), one per column of the matrix.
Definition at line 132 of file GPUVertex.hpp.
|
inlinestatic |
Get the binding description for per-instance data.
Binding 1 carries one 4x4 model matrix per instance at an instance input rate, so identical meshes can be drawn with a single vkCmdDrawIndexed(instanceCount = N).
Definition at line 112 of file GPUVertex.hpp.
Equality operator for GPUVertex.
This operator checks if two GPUVertex instances are equal by comparing their position, color, and texture coordinates. It returns true if all attributes are equal, and false otherwise.
| other | The other GPUVertex instance to compare with. |
Definition at line 160 of file GPUVertex.hpp.
| glm::vec3 evan::GPUVertex::color |
Color of the vertex (TODO: change to vec4 for alpha)
Definition at line 40 of file GPUVertex.hpp.
| glm::vec3 evan::GPUVertex::pos |
Position of the vertex.
Definition at line 39 of file GPUVertex.hpp.
| glm::vec2 evan::GPUVertex::texCoord |
Texture coordinates of the vertex.
Definition at line 46 of file GPUVertex.hpp.