CuteAlien wrote:Vertex order shouldn't matter as only the indices describe the order. That's unless you work without indices in which case I think some defaults are used and then vertex order would matter.
Mel wrote:The indices matters. They describe the order of the sides of a triangle and thus its winding.
I see, so I knew it correctly from the beginning

Then it must be something wrong with indices.
Mel wrote:The only way to make sure that nothing is hidden wrong is to disable the backface culling.
the thing is that front faces get culled and back faces don't with backface culling.
If I wind them CW I get normal results, but I my front faces are set to CCW.
Here's how I wind the cube:
Faces:
Code: Select all
faceIndices
({
{7,6,5,4},///top
{4,5,1,0},///front
{5,6,2,1},///right
{6,7,3,2},///back
{7,4,0,3},///left
{0,1,2,3} ///bottom
})
winding order:
winding code:
Code: Select all
for(boost::uint32_t i = 0; i < 6; i++)
{
const boost::uint8_t voffset = (i*4) + size;
const boost::uint8_t ioffset = (i*6) + isize;
const boost::uint8_t * winding = /*invertFaceWinding(this->p_nodeVerts, (ECubeFace)i) ? faceWindingInverse :*/ faceWindingMain ;
vertices[0 + voffset] = (Vertex3d(this->p_nodeVerts[faceIndices[i][0]], p_quadTexCoords[0]));
vertices[1 + voffset] = (Vertex3d(this->p_nodeVerts[faceIndices[i][1]], p_quadTexCoords[1]));
vertices[2 + voffset] = (Vertex3d(this->p_nodeVerts[faceIndices[i][2]], p_quadTexCoords[2]));
vertices[3 + voffset] = (Vertex3d(this->p_nodeVerts[faceIndices[i][3]], p_quadTexCoords[3]));
indices[0 + ioffset] = (winding[0]+voffset);
indices[1 + ioffset] = (winding[1]+voffset);
indices[2 + ioffset] = (winding[2]+voffset);
indices[3 + ioffset] = (winding[3]+voffset);
indices[4 + ioffset] = (winding[4]+voffset);
indices[5 + ioffset] = (winding[5]+voffset);
}
I've been trying to fix this for two days, so I thought that it wouldn't hurt if some spare eyes would help

I hope I've given enough information.