I'm making a 3D skeletal animation system that stores four bone indices and four bone weights in each vertex. The bone indices are positive integers, and I'd like to use buffer_ubyte4 for this. But I can't get it to work.
Here's a simple test I made:
When drawing this with a custom shader, all indices in in_Colour will be 0. Why is this? Am I doing something wrong or does it just not work? I get it to work if I use buffer_float4 instead, but that is very wasteful...
Here's a simple test I made:
Code:
//Initialize vertex format and create a simple shape
vertex_format_begin();
vertex_format_add_position_3d();
vertex_format_add_custom(vertex_type_ubyte4, vertex_usage_colour);
format = vertex_format_end();
vBuff = vertex_create_buffer();
vertex_begin(vBuff, format);
vertex_position_3d(vBuff, 0, 0, 0);
vertex_ubyte4(vBuff, random(256), random(256), random(256), 255);
vertex_position_3d(vBuff, 200, 0, 0);
vertex_ubyte4(vBuff, random(256), random(256), random(256), 255);
vertex_position_3d(vBuff, 0, 200, 0);
vertex_ubyte4(vBuff, random(256), random(256), random(256), 255);
vertex_position_3d(vBuff, 200, 200, 0);
vertex_ubyte4(vBuff, random(256), random(256), random(256), 255);
vertex_end(vBuff);
Last edited: