Sign in to follow this  

Often TextureState changing and performance

This topic is 4549 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 it too slow to often change TextureState and SetTexture? Some of my meshs have one set of UVs, and some more, and for each mesh (or for every subset of mesh) i set Material, Texture, TextureState (mostly, becuase my models can have up to 2 set of UVs and different blending ops)? And if it is slow, how to optimize this? ZThanks, Zaharije Pasalic

Share this post


Link to post
Share on other sites
Well something isn't slower than beyond what it is possible to optimize, meaning that if you have to change you change, but as few times as possible.

Setting texturestage I believe is not so costy, the possible cost is the settexture which if used infrequently during a render can be costy as the texture might have been removed from the graphicscard and needs to be sent again.

Try batching all renders that use a certain texture and then the different texturestates. Changing texture each time you get a new mesh or renderstate however is not optimal (but doesn't likely hurt extremely much either if you only render a couple of models)

Share this post


Link to post
Share on other sites
You cannot judge performance without instrumentation [smile] - yes, it is usually found that changing texture's is an expensive operation, but how expensive and more importantly how much it affects YOUR application is near impossible to say. Load up 'PIX for Windows' and have a look at whats actually hurting you.

I noticed the other day that circlesoft put up a list of state change performance characteristics, maybe you want to have a look through those.

Syranide put it well - there is a limit at which you can't optimize, if you need to change your texture you should. What you want to look at is ways to reduce the number of times that you **need** to change that texture.

hth
Jack

Share this post


Link to post
Share on other sites

This topic is 4549 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.

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