Original Post
I've spent so much time looking into lighting techniques and rendering techniques I forgot to pay attention to the basics.
I'm setting up the basics of my engine but I have no clue on how I should be laying out my model class.
should it hold an array of meshes?
what information should the bones hold? position, scale, rotation? the vertices its attached to?
how should I handle meshes split into sub-meshes to lessen draw call strain?
So far I have a MeshClass which looks like this
The template is set up ready to use the following types for VertexType's
if there is some I may be missing for use with a full featured engine let me know.
Bar this I'm not sure where to go from here, I could take a swing at it but on the off chance I'm wrong I'll have to rebuild the base of the engine later in development. which could lead to bigger issues.
So if anyone could help me with the ModelClass layout that would be great,
Any and all help appreciated,
Thanks in advanced,
Bombshell
I'm setting up the basics of my engine but I have no clue on how I should be laying out my model class.
should it hold an array of meshes?
what information should the bones hold? position, scale, rotation? the vertices its attached to?
how should I handle meshes split into sub-meshes to lessen draw call strain?
So far I have a MeshClass which looks like this
template<typename VertexType>
class MeshClass
{
public:
__declspec(dllexport) MeshClass();
__declspec(dllexport) ~MeshClass();
__declspec(dllexport) void CreateMesh(LPDIRECT3DDEVICE9, VertexType*, unsigned long, unsigned long*, unsigned long);
__declspec(dllexport) void Draw(LPDIRECT3DDEVICE9);
private:
LPDIRECT3DVERTEXBUFFER9 VertexObject;
LPDIRECT3DINDEXBUFFER9 IndexObject;
LPDIRECT3DVERTEXDECLARATION9 VertDeclaration;
void* VertexBuffer;
void* IndexBuffer;
unsigned long VertexCount;
unsigned long IndexCount;
};The template is set up ready to use the following types for VertexType's
struct Vertex; //Position (Position is in all VertexTypes)
struct Vertex_COL; //Colour
struct Vertex_UV; //UV Co-ords
struct Vertex_NORM; //Normals
struct Vertex_COL_UV; //Colour + UV
struct Vertex_COL_NORM; //Colour + Normals
struct Vertex_UV_NORM; //UV + Normals
struct Vertex_COL_UV_NORM; //Colour + UV + Normals
struct Vertex_UV_NORM_TANGENT; //UV + Normals + Tangents
struct Vertex_COL_UV_NORM_TANGENT; //Colour + UV + Normals + Tangentsif there is some I may be missing for use with a full featured engine let me know.
Bar this I'm not sure where to go from here, I could take a swing at it but on the off chance I'm wrong I'll have to rebuild the base of the engine later in development. which could lead to bigger issues.
So if anyone could help me with the ModelClass layout that would be great,
Any and all help appreciated,
Thanks in advanced,
Bombshell