D3DXEffect vs. Texture vs. My Own Effect Class

Started by
2 comments, last by Drilian 22 years, 1 month ago
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
Advertisement
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?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
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.

EvilDecl81
Thanks for the help

This topic is closed to new replies.

Advertisement