Archived

This topic is now archived and is closed to further replies.

TheAIDSVirus

Setting textures efficiently

Recommended Posts

Is there a way to render a primitive with different textures without calling DrawPrimitive() for every individual texture? For example, say I have three cubes, each with a different texture. Would there be a way to render them with a single index buffer? ---- AIDS

Share this post


Link to post
Share on other sites
No, each call to DrawPrimitive uses the current texture(s) that have been set with device->SetTexture(). If you want to make your game very efficient, you will render ALL the objects that are using texture(A) in the same call to draw primitive (or sequential calls to draw primitive), then you''ll render all objects with texture B, then C, and so on. This is because changing textures is an expensive operation and should be minimized.

Brett

Share this post


Link to post
Share on other sites