Sign in to follow this  
POLSKASH

Quick Q about IDirect3DTexture9

Recommended Posts

Would it be a huge performance drag if I had a lot of IDirect3DTexture9 interface pointers? I know that using multiple ID3DXSprite interfaces is a drag, but what about the texture?

Share this post


Link to post
Share on other sites
Changing textures is an expensive state change. You should try to have as few as you can and group your rendering by texture.

Share this post


Link to post
Share on other sites
Oh ok, thanks. And also, is the D3DXCreateTextureFromFileEx() function fast enough so I could use it extensively in real-time and not take a significant performance hit?

Share this post


Link to post
Share on other sites
No function that loads a texture from a file would be fast enough for realtime. You will need to load them up front.

Share this post


Link to post
Share on other sites
Quote:

POLSKASH:
Would it be a huge performance drag if I had a lot of IDirect3DTexture9 interface pointers?

Dave Hunt: Changing textures is an expensive state change. You should try to have as few as you can and group your rendering by texture.

Holding many pointers (interfaces) is not a performance drag. It only drains some memory but this is nothing compared to the data of the textures in them. Usually, you need one of these for each texture you have.

Then, switching textures (as an actual setting on the device) is however expensive, as Dave pointed out. Just making sure you're not talking past each other.

Greetz,

Illco

Share this post


Link to post
Share on other sites
Quote:
Original post by Illco
Just making sure you're not talking past each other.


Good point. I kind of ignored his written question and answered the underlying one.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this