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

Material-Pipeline-Mesh Architecture

$
0
0
Hey guys, so as I'm revamping my entire rendering system, I decided to go by an object-centric draw cycle to a pipeline-centric one. So basically I bind pipelines, then materials, then the mesh, rather than the buffers for the entire model and then go looking for the pipeline. I'm having issues designing the architecture for this. I figured I'd have: MaterialSystem: vector<RenderPassContainer> map<string, Pipeline *> map<string, Material *> RenderPassContainer: RenderPassObject vector<PipelineContainer> PipelineContainer: PipelineObject vector<Material> Material: TextureBinding (group of textures) vector<Mesh *> Mesh: BaseVertix BaseIndex NumIndices Material * So the issue here is that when I create new materials, the map and all pointers are pointing to the wrong area in memory. Any ideas for a better architecture? Keep in mind I need to: Add Materials, Add Pipelines, Add meshes Remove Meshes (and materials and pipelines if there are no instances left), and Update materials and pipelines at runtime. Thanks!

Viewing all articles
Browse latest Browse all 17825

Trending Articles



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