Files
Seele/src/Engine/Graphics/StaticMeshVertexData.h
T

49 lines
1.7 KiB
C++
Raw Normal View History

2023-10-29 09:20:23 +01:00
#pragma once
#include "Graphics/Initializer.h"
2023-11-15 00:06:00 +01:00
#include "Graphics/Command.h"
2023-11-05 10:36:01 +01:00
#include "Math/Vector.h"
2023-10-07 19:29:53 +02:00
#include "VertexData.h"
namespace Seele
{
class StaticMeshVertexData : public VertexData
{
public:
2023-10-31 16:16:23 +01:00
StaticMeshVertexData();
2023-10-07 19:29:53 +02:00
virtual ~StaticMeshVertexData();
2023-10-31 16:16:23 +01:00
static StaticMeshVertexData* getInstance();
void loadPositions(MeshId id, const Array<Vector>& data);
2024-05-06 18:36:16 +02:00
void loadTexCoords(MeshId id, uint64 index, const Array<Vector2>& data);
2023-10-31 16:16:23 +01:00
void loadNormals(MeshId id, const Array<Vector>& data);
void loadTangents(MeshId id, const Array<Vector>& data);
void loadBiTangents(MeshId id, const Array<Vector>& data);
2023-11-11 22:39:17 +01:00
void loadColors(MeshId id, const Array<Vector>& data);
2023-11-01 13:38:49 +01:00
virtual void serializeMesh(MeshId id, uint64 numVertices, ArchiveBuffer& buffer) override;
virtual void deserializeMesh(MeshId id, ArchiveBuffer& buffer) override;
2023-10-31 16:16:23 +01:00
virtual void init(Gfx::PGraphics graphics) override;
2023-12-12 11:37:00 +01:00
virtual void destroy() override;
2023-10-31 17:55:30 +01:00
virtual void bindBuffers(Gfx::PRenderCommand command) override;
virtual Gfx::PDescriptorLayout getVertexDataLayout() override;
virtual Gfx::PDescriptorSet getVertexDataSet() override;
virtual std::string getTypeName() const override { return "StaticMeshVertexData"; }
2023-10-07 19:29:53 +02:00
private:
2023-11-01 23:12:30 +01:00
virtual void resizeBuffers() override;
2023-10-31 16:16:23 +01:00
virtual void updateBuffers() override;
2024-05-01 14:10:52 +02:00
std::mutex mutex;
2023-11-01 23:12:30 +01:00
Gfx::OShaderBuffer positions;
2023-10-31 16:16:23 +01:00
Array<Vector> positionData;
2024-05-06 18:36:16 +02:00
Gfx::OShaderBuffer texCoords[MAX_TEXCOORDS];
Array<Vector2> texCoordsData[MAX_TEXCOORDS];
2023-11-01 23:12:30 +01:00
Gfx::OShaderBuffer normals;
2023-10-31 16:16:23 +01:00
Array<Vector> normalData;
2023-11-01 23:12:30 +01:00
Gfx::OShaderBuffer tangents;
2023-10-31 16:16:23 +01:00
Array<Vector> tangentData;
2023-11-01 23:12:30 +01:00
Gfx::OShaderBuffer biTangents;
2023-10-31 16:16:23 +01:00
Array<Vector> biTangentData;
2023-11-11 22:39:17 +01:00
Gfx::OShaderBuffer colors;
Array<Vector> colorData;
2023-11-01 23:12:30 +01:00
Gfx::ODescriptorLayout descriptorLayout;
2023-11-05 10:36:01 +01:00
Gfx::PDescriptorSet descriptorSet;
2023-10-07 19:29:53 +02:00
};
2023-10-29 09:20:23 +01:00
}