From: Josh <axl...@gm...> - 2009-08-16 23:24:14
|
I made a rather major change to mercury 2. As before, assets are instanced. One copy of an asset is loaded and uses wherever that asset is used. The assets were stored using auto pointers in the mercury nodes. Now for the change... Assets are still instanced. But now instead of being stored in auto pointers in nodes they are stored in MercuryAssetInstance classes. These classes are stored in nodes. This allows us to store some per-instance data for assets. Right now I use this for frustum culling, and occlusion tests. We could also put other things there, like a global matrix, or even make the innstance data specific to the type. You could do something with models where you load an animated model once but keep its animation data specific to each instance. Also, because of this change, I removed the prerender, render, and post render lists. All assets have prerender, render, and postrender executed all the time. We can approach this differently later to make it more efficient, it probably needs to be tied in with your experimental multi-pass render. |