Archived

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

Drilian

D3DXEffect vs. Texture vs. My Own Effect Class

Recommended Posts

Alright, so this question is a two-parter: 1. I have a D3DXEffect set per-object. Should I sort by Texture then by Effect, or by Effect then by Texture to be more efficient? 2. Should I USE D3DXEffect, or should I write my own class that has the same capability? I mean, is it like D3DXFont, where you don''t want to use it in a real production because it''s really slow, or can I say "D3DXEffect isn''t going to slow me down any more than my own code would"? Thanks, Josh

Share this post


Link to post
Share on other sites
Quote NVIDIA here:

Regarding PS and VS state changes

"This is an intrinsically expensive state change
I’ve seen apps for which this is the “thing-to-sort-by”
Which means it can be more expensive than texture changes"

Neil


WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites
It is unlikely that you will beat the performance of D3DXEffect, since D3DXEffect uses stateblocks. You can use the binary format for faster loading.

Usually, it is fastest to sort by texture. However, since in most scenarios ps vs shaders require different textures (i.e. a bump map shader can''t use the same textures as another), you might want to sort by vertex/ps pair first, and then sort by textures.

Share this post


Link to post
Share on other sites