Quick Q about IDirect3DTexture9

Started by
4 comments, last by Dave Hunt 18 years, 9 months ago
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?
There are some things so stupid that only an intellect could believe them.
Advertisement
Changing textures is an expensive state change. You should try to have as few as you can and group your rendering by texture.
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?
There are some things so stupid that only an intellect could believe them.
No function that loads a texture from a file would be fast enough for realtime. You will need to load them up front.
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
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.

This topic is closed to new replies.

Advertisement