-1
\$\begingroup\$

As I am learning the basics of game programming (in xna), I want to start creating simple 3d models and draw them (I'm already able to draw, control and animate them).

I want to create the following: a square surrounded by pillars.

What is better (in terms of performance and work):

  1. Create a model containing the square and 20 prepositioned (of the same) pillars

  2. Create a square and 1 pillar and then position and draw 20 pillars

Options 1 is obviously less work, but I think option 2 is better for performance.

Is this logical thinking and what do you think is the best option?

\$\endgroup\$
  • \$\begingroup\$ The "best" option is to try it yourself and see what's faster. I will put my money on option 1 being almost 20 times faster ;) You will only gain performance benefit this way if the pillar is incredibly expensive to draw, and you use effective culling. \$\endgroup\$ – MickLH Sep 6 '13 at 14:57
  • \$\begingroup\$ thanks! I think your comment is sufficient as an answer, could you add your comment as an answer so I can accept it? \$\endgroup\$ – Maarten Hartman Sep 6 '13 at 15:04
  • \$\begingroup\$ why a downvote? I just started game programming and I'm already thinking about performance, learning it the right way. weird. \$\endgroup\$ – Maarten Hartman Sep 6 '13 at 15:10
  • \$\begingroup\$ Well I didn't vote that, but my guess it because of a few things generally not appreciated on this site. 1. It's premature optimization, wait until you get unacceptable performance and then use a profiler to see where its coming from. 2. In any case with optimization try it in your specific program and measure real numbers with your profiler. 3. Asking for the "best" anything can start up an opinion blast. \$\endgroup\$ – MickLH Sep 6 '13 at 15:26
  • \$\begingroup\$ alright I agree with you on 2 and 3. For 1: I dont think your approach is efficient developing; why not write efficient code from the start instead of refactoring it afterwards? (which I have to do anyway but it will save some work and lines). Thanks for your comment though, always learning. \$\endgroup\$ – Maarten Hartman Sep 11 '13 at 1:34
1
\$\begingroup\$

The "best" option is to try it yourself and see what's faster. I will put my money on option 1 being faster.

You will only gain performance benefit this way if the pillar is incredibly expensive to draw, and you use effective culling.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.