You can set multiple vertex buffers with IASetVertexBuffers, but there is no plural version of IASetIndexBuffer. What is the point of creating (non-interleaved) multiple vertex buffer datas if you wont be able to refer them with individual index buffers
(assume i have a struct called vector3 with 3 floats x,y,z)
let say i have a model of human with 250.000 vertices and 1.000.000 triangles;
- i will create a vertex buffer with size of 250.000 * sizeof(vector3) for vertex LOCATIONS and also,
- i will create another vertex buffer with size of 1.000.000 * 3 * sizeof(vector3) for vertex NORMALS (and propably another for diffuse texture)
i can set these vertex buffers like:
ID3D11Buffer* vbs[2] = { meshHandle->VertexBuffer_Position, meshHandle->VertexBuffer_Normal };
uint strides[] = { Vector3f_size, Vector3f_size };
uint offsets[] = { 0, 0 };
ImmediateContext->IASetVertexBuffers(0, 2, vbs, strides, offsets);
how can i set seperated index buffers for these vertex datas if IASetIndexBuffer only supports 1 index buffer
and also (i know there are techniques for decals like creating extra triangles from the original model but) let say i want to render a small texture like a SCAR on this human model's face (let say forehead), and this scar will only spread through 4 triangles, is it possible creating a uv buffer (with only 4 triangles) and creating 3 different index buffers for locations, normals and UVs for only 4 triangles but using the same original vertex buffers (same data from full human model). i dont want to create tonnes of uv data which will never be rendered beside characters forehead (and i dont want to re-use, re-create vertex position datas for this secondary texture layers (decals))
EDIT: i realized i didnt properly ask a question, so my question is:
- did i misunderstand non-interleaved model structure (is it being used for some other reason instead having non-aligned vertex components)?
- or am i approaching non-interleaved structure wrong (is there a way defining multiple non-aligned vertex buffers and drawing them with only one index buffer)?