Fixing slang compilation temporarily, renaming vertexfactory

This commit is contained in:
Dynamitos
2020-08-06 00:54:43 +02:00
parent ab4a3b5e23
commit f27859a02c
66 changed files with 1005 additions and 627 deletions
+25 -15
View File
@@ -1,20 +1,13 @@
#pragma once
#include "GraphicsResources.h"
#include "Material/MaterialAsset.h"
namespace Seele
{
#define MAX_TEX_CHANNELS 4
enum class VertexAttribute
{
POSITION,
TEXCOORD,
NORMAL,
TANGENT,
BITANGENT
};
#define MAX_TEX_CHANNELS 8
struct MeshDescription
{
Array<VertexAttribute> layout;
Array<Gfx::VertexAttribute> layout;
Gfx::PVertexDeclaration declaration;
uint32 getStride() const
{
@@ -27,19 +20,27 @@ struct MeshDescription
{
switch (a)
{
case VertexAttribute::POSITION:
case VertexAttribute::NORMAL:
case VertexAttribute::TANGENT:
case VertexAttribute::BITANGENT:
case Gfx::VertexAttribute::POSITION:
case Gfx::VertexAttribute::NORMAL:
case Gfx::VertexAttribute::TANGENT:
case Gfx::VertexAttribute::BITANGENT:
vertexSize += 3;
break;
case VertexAttribute::TEXCOORD:
case Gfx::VertexAttribute::TEXCOORD:
vertexSize += 2;
break;
}
}
return vertexSize;
}
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive& ar, const unsigned int version)
{
ar & layout;
//TODO declaration
}
};
DECLARE_REF(MaterialAsset);
class Mesh
@@ -51,6 +52,15 @@ public:
Gfx::PIndexBuffer indexBuffer;
MeshDescription description;
PMaterialAsset referencedMaterial;
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive& ar, const unsigned int version)
{
ar & description;
ar & referencedMaterial->getFullPath();
//TODO:
}
};
DEFINE_REF(Mesh);
} // namespace Seele