Design Issues - special model or special render technique

This topic is 3051 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

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;
if(gfx.hasMultiTexturing())
model = new MultiTexturedGrid(scenario);
else
model = new BruteForceGrind(scenario);

renderer->render(model);


or
Model * model = new GridModel(scenario);
renderer->render(model);
//... and
Renderer::render(Model * m)
{
if(gfx.hasMultiTexturing())
//multitex rendering
else
//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]

• 37
• 12
• 10
• 10
• 9
• Forum Statistics

• Total Topics
631360
• Total Posts
2999554
×