• Advertisement

Archived

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

Setting textures efficiently

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

If you intended to correct an error in the post then please contact us.

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
Advertisement
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

  • Advertisement