#pragma pack(push,1)
-/* 24 byte vertexs, we don't care about the normals too much,
+/* 28 byte vertexs, we don't care about the normals too much,
* maybe possible to bring down uv to i16s too */
struct scene_vert
{
v3f co; /* 3*32 */
v2f uv; /* 2*32 */
i8 norm[4]; /* 4*8 */
+ u8 lights[4]; /* 4*8 */
};
#pragma pack(pop)
VG_STATIC scene *scene_fix( void *lin_alloc, scene *pscene )
{
/* FIXME: Why is this disabled? */
-
return pscene;
+
u32 vertex_count = pscene->vertex_count,
indice_count = pscene->indice_count,
vertex_length = vertex_count * sizeof(scene_vert),
index_length = indice_count * sizeof(u32),
- tot_size = sizeof(scene) + vertex_length + index_length;
+ tot_size = sizeof(scene) + vertex_length + index_length;
/* copy down index data */
void *dst_indices = pscene->arrvertices + vertex_length;
stride, (void *)offsetof(scene_vert, uv) );
glEnableVertexAttribArray( 2 );
+ /* 3: light cluster */
+ glVertexAttribIPointer( 3, 4, GL_UNSIGNED_BYTE,
+ stride, (void *)offsetof(scene_vert, lights) );
+ glEnableVertexAttribArray( 3 );
+
VG_CHECK_GL_ERR();
mesh->indice_count = pscene->indice_count;