Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

Models, model matrices, and rendering

$
0
0
I was thinking about how to render multiple objects. Things like sprites, truck models, plane models, boats models, etc. And I'm not too sure about this process Let's say I have a vector of Models objects class Model { Matrix4 modelMat; VertexData vertices; Texture texture; Shader shader; }; Since each model has is own model matrix, as all models should, does this mean I now need to have 1 draw call per model? Because each model that needs to be drawn could change the MVP matrix used by the bound vertex shader. Meaning I have to keep updating/mapping the constant buffer my MVP matrix is stored in, which is used by the vertex shader Am I thinking about all of this wrong? Isn't this horribly inefficient?

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>