Shader for rendering indexed meshes.
More...
|
| | MeshShader (Mesh< VertexType > *mesh) |
| | Constructs the MeshShader with a mesh. The Model-View-Projection (MVP) matrix and the transform matrix are initialized to the identity matrix.
|
| |
| | MeshShader (Mesh< VertexType > *mesh, Camera *camera) |
| | Constructs the MeshShader with a mesh. The transform is initialized to identity, the transform is initialized to identity and the mvp to the camera's projectionView.
|
| |
|
void | WriteDescriptors (VkDescriptorSet set) |
| | Writes this class's 3 descriptors to the set, this method must be called before rendering with this shader. Slot 0 mvp: VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER. Slot 1 vertex: VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER. Slot 2 index: VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER.
|
| |
|
void | Update () |
| | Must be called after every update to the camera or this transform.
|
| |
|
|
MatrixRowMajor< float, 4, 4, 1 > | transform |
| |
|
Mesh< VertexType > * | mesh |
| |
|
Camera * | camera |
| |
|
Buffer< MatrixRowMajor< float, 4, 4, 1 > > | mvp |
| |
|
std::uint32_t | threadCount |
| |
template<typename VertexType>
class Crafter::MeshShader< VertexType >
Shader for rendering indexed meshes.
- Template Parameters
-
| VertexType | The vertex type to use that is internally stored, this must match the type the glsl shader expects. |
◆ MeshShader() [1/2]
template<typename VertexType>
Constructs the MeshShader with a mesh. The Model-View-Projection (MVP) matrix and the transform matrix are initialized to the identity matrix.
- Parameters
-
| mesh | Pointer to the mesh to use. The mesh must remain valid for the lifetime of this object. |
◆ MeshShader() [2/2]
template<typename VertexType>
Constructs the MeshShader with a mesh. The transform is initialized to identity, the transform is initialized to identity and the mvp to the camera's projectionView.
- Parameters
-
| mesh | Pointer to the mesh to use. The mesh must remain valid for the lifetime of this object. |
| mesh | Pointer to the camera to use. The camera must remain valid for the lifetime of this object. |
The documentation for this class was generated from the following file:
- src/module/Crafter.Graphics-MeshShader.cppm