How many BasicEffects do you have in a Game? What is the best way to render multiple objects/shapes at once?

Posted by Deukalion on Game Development See other posts from Game Development or by Deukalion
Published on 2012-06-27T16:11:04Z Indexed on 2012/06/27 21:26 UTC
Read the original article Hit count: 226

I'm trying to understand 3D rendering and it seems that everytime you render a new object (A 3D Cube or something) you need to have a new BasicEffect for each Box you render unless you want the exact same texture?

...so if I have over a hundred boxes with each different textures, I need at least as many BasicEffects? Will that not be "too much" for the CPU/GPU in the end or result in lagging? Is there any good way to render multiple objects (cubes or other shapes) at the same time?

I've tried changing the BasicEffect.Texture with each cube drawn, but it resulting in changing the first Cube's texture too.

Any suggestions would be really appreciated, I'm really new to 3D in XNA so I'm trying to wrap my head around the best methods for example render a Map with objects (of shapes).

© Game Development or respective owner

Related posts about XNA

Related posts about c#