I have a C ++ DirectX 11 visualizer that I am writing.
I wrote a COLLADA 1.4.1 loader to import COLLADA data for use in skeletal animation support.
I check the bootloader at this stage (and I supported COLLADA earlier in another renderer that I wrote earlier using different technologies), and I ran into a problem that matches COLLADA with DX10 / 11.
I have 3 separate vertex data buffers:
A vertex buffer of unique vertex positions. A vertex buffer of unique normals. A vertex buffer of unique texture coordinates.
These vertex buffers contain different lengths of the array (positions have 2910 elements, normals have more than 9000, and texture coordinates are about 3200).
COLLADA provides a list of triangles that gives me the indices in each of these arrays for a given triangle (verbose and weird is done at first, but eventually becomes simple after you worked with it.)
Knowing that DX10 / 11 supports multiple vertex buffers, I decided that I would fill the DX10 / 11 index buffer with indices in each of these buffers * and * (this is an important part), these indices may differ for a given point of the triangle.
In other words, I could set three vertex buffers, set the correct input layout, and then in the index buffer I would put the equivalent:
l_aIndexBuffer[ NumberOfTriangles * 3 ]
for( i = 0; i < NumberOfTriangles; i++ )
{
l_aIndexBufferData.add( triangle[i].Point1.PositionIndex )
l_aIndexBufferData.add( triangle[i].Point1.NormalIndex )
l_aIndexBufferData.add( triangle[i].Point1.TextureCoordinateIndex )
}
The documentation on using multiple vertex buffers in DirectX does not seem to provide any information on how this affects the index buffer (more on this later).
, , ( , - - )
, () , , , - . , , , , , .
, DX10/11 , -, :
indices.add( Point1Position index )
indices.add( Point2Position index )
indices.add( Point3Position index )
indices.add( Point1Normal index )
indices.add( Point2Normal index )
indices.add( Point3Normal index )
indices.add( Point1TexCoord index )
indices.add( Point2TexCoord index )
indices.add( Point3TexCoord index )
, , 1/3 - - .
, , , DX10/DX11 , , " ", , , , .
1/3 () .
- , , DX10/11 ?
, , , .
, .
?
- ?
.
Help!