(i'm using opengl 4.0 but this question is rather theroetical so thats not important)
currently i have a structure, like this (simplified)
model{ // object on screen with a world matrix
modelpart{ // a part of the model with a material, e.g. arm, leg, or pants, or window (if model is a house..)
mesh { vertBuffer, iBUffer... etc.. }
}
}
when i render, i activate the models shader, a normal shader for example ( sometimes in renderlists a shader is even activated along multiple models)
my question is, what if i would like to have different shaders on each modelpart, how do you guys go on about that?
if for example the naked arm has a different shader than some fancy blink metal armor on the chest, or a part has normalmapping, and a part is parallax?
because at the moment the Model->Render() method sets a ModelViewMatrix for the active shader, and now each ModelPart would need a reference to the parent Model's ModelViewMatrix, and activate it's own shader and set the modelviewmatrix
is this situation even realistic or does a shader per model suffice in most cases? Or is it that extreme that instead of rendering Models, you have renderlists of modelparts with the same shader?
would it help to chang my model structure somehow?
thanks in advance