tec::vertex::FormatInfo

More...

Public Functions

Name
FormatDefine< Vertex > define_format((void dest, const Mesh source) { auto destination=(vertex::Vertex *) destfor(size_t i=0i< source->vert_count() i++) { destination[i]=source->base_verts[i]} } , AttribData{0, 3, GL_FLOAT, GL_FALSE, offsetof(Vertex, position)} , AttribData{1, 3, GL_FLOAT, GL_FALSE, offsetof(Vertex, normal)} , AttribData{2, 2, GL_FLOAT, GL_FALSE, offsetof(Vertex, uv)} )
FormatDefine< ColorVertex > define_format((void dest, const Mesh source) { auto destination=(vertex::ColorVertex *) destfor(size_t i=0i< source->vert_count() i++) { destination[i].vert=source->base_verts[i]destination[i].color=source->vert_color[i]} } , AttribData{0, 3, GL_FLOAT, GL_FALSE, offsetof(ColorVertex, vert.position)} , AttribData{1, 3, GL_FLOAT, GL_FALSE, offsetof(ColorVertex, vert.normal)} , AttribData{2, 2, GL_FLOAT, GL_FALSE, offsetof(ColorVertex, vert.uv)} , AttribData{3, 4, GL_FLOAT, GL_FALSE, offsetof(ColorVertex, color)} )
FormatDefine< LiteFullVertex > define_format((void dest, const Mesh source) { auto destination=(vertex::LiteFullVertex ) destfor(size_t i=0i< source->vert_count() i++) { destination[i].position=source->base_verts[i].positiondestination[i].pack_normal=glm::packSnorm3x10_1x2(glm::vec4(source->base_verts[i].normal, 0.f)) reinterpret_cast< uint32_t * >(&destination[i].uv)=glm::packHalf2x16(source->base_verts[i].uv) if(source->has_color) reinterpret_cast< uint32_t * >(&destination[i].color)=glm::packUnorm4x8(source->vert_color[i]) if(source->has_weight) { reinterpret_cast< uint32_t * >(&destination[i].bone_weights)=glm::packUnorm4x8(source->vert_weight[i].bone_weights) destination[i].bone_indices=source->vert_weight[i].bone_indices} } } , AttribData{0, 3, GL_FLOAT, GL_FALSE, offsetof(LiteFullVertex, position)} , AttribData{1, 4, GL_INT_2_10_10_10_REV, GL_TRUE, offsetof(LiteFullVertex, pack_normal)} , AttribData{2, 2, GL_HALF_FLOAT, GL_FALSE, offsetof(LiteFullVertex, uv)} , AttribData{3, 4, GL_UNSIGNED_BYTE, GL_TRUE, offsetof(LiteFullVertex, color)} , AttribData{4, 4, GL_UNSIGNED_BYTE, GL_TRUE, offsetof(LiteFullVertex, bone_weights)} , AttribData{5, 4, GL_UNSIGNED_BYTE, GL_FALSE, offsetof(LiteFullVertex, bone_indices)} )
FormatDefine< FullVertex > define_format((void dest, const Mesh source) { auto destination=(vertex::FullVertex *) destfor(size_t i=0i< source->vert_count() i++) { destination[i].vert=source->base_verts[i]if(source->has_color) destination[i].color=source->vert_color[i]if(source->has_weight) destination[i].weight=source->vert_weight[i]} } , AttribData{0, 3, GL_FLOAT, GL_FALSE, offsetof(FullVertex, vert.position)} , AttribData{1, 3, GL_FLOAT, GL_FALSE, offsetof(FullVertex, vert.normal)} , AttribData{2, 2, GL_FLOAT, GL_FALSE, offsetof(FullVertex, vert.uv)} , AttribData{3, 4, GL_FLOAT, GL_FALSE, offsetof(FullVertex, color)} , AttribData{4, 4, GL_FLOAT, GL_FALSE, offsetof(FullVertex, weight.bone_weights)} , AttribData{5, 4, GL_UNSIGNED_INT, GL_FALSE, offsetof(FullVertex, weight.bone_indices)} )

Public Attributes

Name
FormatDefine< Q > define_format

Detailed Description

template <typename Q >
struct tec::vertex::FormatInfo;

Public Functions Documentation

function define_format

FormatDefine< Vertex > define_format(
    (void *dest, const Mesh *source) { auto destination=(vertex::Vertex *) destfor(size_t i=0i< source->vert_count() i++) { destination[i]=source->base_verts[i]} } ,
    AttribData{0, 3, GL_FLOAT, GL_FALSE, offsetof(Vertex, position)} ,
    AttribData{1, 3, GL_FLOAT, GL_FALSE, offsetof(Vertex, normal)} ,
    AttribData{2, 2, GL_FLOAT, GL_FALSE, offsetof(Vertex, uv)} 
)

function define_format

FormatDefine< ColorVertex > define_format(
    (void *dest, const Mesh *source) { auto destination=(vertex::ColorVertex *) destfor(size_t i=0i< source->vert_count() i++) { destination[i].vert=source->base_verts[i]destination[i].color=source->vert_color[i]} } ,
    AttribData{0, 3, GL_FLOAT, GL_FALSE, offsetof(ColorVertex, vert.position)} ,
    AttribData{1, 3, GL_FLOAT, GL_FALSE, offsetof(ColorVertex, vert.normal)} ,
    AttribData{2, 2, GL_FLOAT, GL_FALSE, offsetof(ColorVertex, vert.uv)} ,
    AttribData{3, 4, GL_FLOAT, GL_FALSE, offsetof(ColorVertex, color)} 
)

function define_format

FormatDefine< LiteFullVertex > define_format(
    (void *dest, const Mesh *source) { auto destination=(vertex::LiteFullVertex *) destfor(size_t i=0i< source->vert_count() i++) { destination[i].position=source->base_verts[i].positiondestination[i].pack_normal=glm::packSnorm3x10_1x2(glm::vec4(source->base_verts[i].normal, 0.f)) *reinterpret_cast< uint32_t * >(&destination[i].uv)=glm::packHalf2x16(source->base_verts[i].uv) if(source->has_color) *reinterpret_cast< uint32_t * >(&destination[i].color)=glm::packUnorm4x8(source->vert_color[i]) if(source->has_weight) { *reinterpret_cast< uint32_t * >(&destination[i].bone_weights)=glm::packUnorm4x8(source->vert_weight[i].bone_weights) destination[i].bone_indices=source->vert_weight[i].bone_indices} } } ,
    AttribData{0, 3, GL_FLOAT, GL_FALSE, offsetof(LiteFullVertex, position)} ,
    AttribData{1, 4, GL_INT_2_10_10_10_REV, GL_TRUE, offsetof(LiteFullVertex, pack_normal)} ,
    AttribData{2, 2, GL_HALF_FLOAT, GL_FALSE, offsetof(LiteFullVertex, uv)} ,
    AttribData{3, 4, GL_UNSIGNED_BYTE, GL_TRUE, offsetof(LiteFullVertex, color)} ,
    AttribData{4, 4, GL_UNSIGNED_BYTE, GL_TRUE, offsetof(LiteFullVertex, bone_weights)} ,
    AttribData{5, 4, GL_UNSIGNED_BYTE, GL_FALSE, offsetof(LiteFullVertex, bone_indices)} 
)

function define_format

FormatDefine< FullVertex > define_format(
    (void *dest, const Mesh *source) { auto destination=(vertex::FullVertex *) destfor(size_t i=0i< source->vert_count() i++) { destination[i].vert=source->base_verts[i]if(source->has_color) destination[i].color=source->vert_color[i]if(source->has_weight) destination[i].weight=source->vert_weight[i]} } ,
    AttribData{0, 3, GL_FLOAT, GL_FALSE, offsetof(FullVertex, vert.position)} ,
    AttribData{1, 3, GL_FLOAT, GL_FALSE, offsetof(FullVertex, vert.normal)} ,
    AttribData{2, 2, GL_FLOAT, GL_FALSE, offsetof(FullVertex, vert.uv)} ,
    AttribData{3, 4, GL_FLOAT, GL_FALSE, offsetof(FullVertex, color)} ,
    AttribData{4, 4, GL_FLOAT, GL_FALSE, offsetof(FullVertex, weight.bone_weights)} ,
    AttribData{5, 4, GL_UNSIGNED_INT, GL_FALSE, offsetof(FullVertex, weight.bone_indices)} 
)

Public Attributes Documentation

variable define_format

static FormatDefine< Q > define_format;

Updated on 2022-07-24 at 19:27:35 +0000