Archived

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

Joshua Schpok

Minimize texture or matrix changes?

Recommended Posts

When rendering a scene, you want to minimize the number of texture switches, as they may have to be pulled from system memory. Hardware tackles transformation, which means you''ve got to set the transformation matrix on your card before you start throwing it geometry. With articulated skeletons and the like, you''ll probably be doing lots of matrix switching. I think you could reduce the amount of matrix switching by ordering your geometry by transformation. This could, however, ruin your "by texture" ordering. Example: A tentacle has a seperate top and bottom texture. Texture ordering would draw the top part of the tentacle, switching matrices at each joint, then flip to the bottom texture and draw the bottom geometry switching through each matrix again. t = total textures, j = total joints Texture switches: t-1 Matrix switches: j*t Ordering by transform would draw each joint at a time, switching to top then bottom textures each time. Texture switches: j*t Matrix switches: j-1 It seems you''d want to order via matrix when t is small and j is large. Any ideas? Oddball Studios
http://zap.to/oddball

Share this post


Link to post
Share on other sites