Original Post
Hey all, Kind of a newbie question here, but I've been confused by the documentation. So, I'm working on a tile-based game (3D tiles), which means I've got a bunch of models (for the tiles) to render. A lot of the models are the same for many tiles, if that matters. Now, my immediate thought is to load in the models as-is, and just update the world transform each time I want to render the model to put it in the right place. Sounds fine so far. However, in reading the D3D documentation here: http://msdn2.microsoft.com/en-us/library/bb206365.aspx I read: Direct3D uses the world and view matrices that you set to configure several internal data structures. Each time you set a new world or view matrix, the system recalculates the associated internal structures. Setting these matrices frequently-for example, thousands of times per frame-is computationally time-consuming. You can minimize the number of required calculations by concatenating your world and view matrices into a world-view matrix that you set as the world matrix, and then setting the view matrix to the identity. Keep cached copies of individual world and view matrices so that you can modify, concatenate, and reset the world matrix as needed. For clarity, in this documentation Direct3D samples rarely employ this optimization. Now, if I take this warning seriously, I can do all sorts of things to avoid setting the world transform. However, at least as far as I considered, any of these solutions involve me loading models a bunch of times each, and doing lots of transforms manually. I can certainly do these things without undue trouble, but it just seems like I'll be doing all of the computation manually that I'm trying to save, and probably using up a bunch more memory in addition. So in a nutshell, is it appropriate to use the world transform to move models around when rendering, or will I get better results with some other technique? Thanks, Geoff