I'm still in the planning phase for a hobby abstract renderer, and i'm wondering how i should handle multiple vertex types and different shader inputs. (This is my first graphics project, so cut me some slack for lack of knowledge :) ).
What I want to to do is have the vertices be typeless, and have my model file specify "channels" of attributes EX: position, color, normal, binormal, tanget, etc. These channels would have string identifiers and stride values. On the shader side, i would like each shader program to specify which "channels" it requires via the identifier. Vertex Buffers would be compatible with the shaders if they had all the attributes required by the shader.
this is all abstract so I must be able to implement the functionality in most API's. However, taking a look over at D3D11, it looks like i would have to create a new Input layout per Vertex Buffer/ Shader COMBINATION. It would also mean some sort of goofy cataloguing system that goes, "if you have this specific combination of attribs, and the shader requires this specific combination of attribs, then use this layout", which makes me a little queasy thinking about it :\ . The number of input layouts would grow exponentially with more combinations.
The other solution would be to create and delete a new input layout EVERY time you wish to render. same queasiness -_-. Was D3D11 intentionally trying to force every vertex buffer in your design to have the same type?
Does anyone have a better suggestion? the main parameters i would like are the channel based vertex buffers, and the channel receiving shaders.