Sign in to follow this  

Design Issues - special model or special render technique

Recommended Posts

Hi, So i have this 2D tile engine which should support a lot of layers of blended textures for each grid element. The layers i mentioned are defined by a category. So i will have stuff like -terrain layer -vegetation layer -building layer -weather layer -field is selected -special modfiers -etc. (but this sums up to 8+ layers at minimum, but some of them might be empty (the field has no building or so)) I am already using texture atlases to make sure i can use render an entire grid (which might contain 500x500 fields at each layer) at once using vbos and texpointers and whatnot. That's quite nice. This would still require a rendercall for each layer. ;( Let's say: 8 layers, 8 massive glDrawElements calls for 500x500 values. So i thought i could somehow devide my effort by "X" (depending on the multitex capabilities) by using multi-texturing and blend "X" layers together on the GPU. Now, this whole thing effects the way my models are represented. The first explained method will basicly just position several "models" in a way so it looks like they were stacked, where the second way actually interprets the model as one artifact. My actual problem is, i could a) try to built a suitable model (according to the render capabilities) b) use a generic model and have the renderer reinterpret it depending on the capabilities. I hope i was able to state my problem, and i'm very happy for any response. P.S: Changes in my "Model" are quite seldom (in gfx specific terms), it's a map editor for Civilization 4 tbh. Greetings Edit:
Model * model;
   model = new MultiTexturedGrid(scenario);
   model = new BruteForceGrind(scenario);


Model * model = new GridModel(scenario);
//... and 
Renderer::render(Model * m)
    //multitex rendering
    //usual rendering

I thought i'd rather go with specific models, even if it couples the render specs to the models. But since the renderer should have compartible data structures to be effective, i don't want the renderer to have to take his hands on the data structure. [Edited by - GreyHound on February 9, 2010 2:42:30 PM]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this