Public Group

#### Archived

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

# Hardware (T&L) acceleration in DirectX

This topic is 5869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have been studying the DirectX extension for a while, and pondering how to code most effectively. Obviously, a custom-made matrix multiplication (that takes into account for the zeros in the simple matrices, like translation and rotation) may be a lot faster than one in the libraries, for example provided by DirectX. However, if this work is off-loaded into the GPU, it might be more effective than my own routine in the CPU. As far as I understand T&L (DirectX 8 hardware), I have to provide the GPU with a complete world-view matrix and a projection matrix. So far so good, but can I just give it a world and a view matrix and it does it as well? Basically my question is, in DirectX, what transformations are handled by the CPU, and what by the GPU?

##### Share on other sites
You only set up the matrices all other work is done by the GPU...

##### Share on other sites
I am confused then, though, why the DirectX 8 SDK recommends to use a combined world-view matrix instead of separate matrices for world and view.

##### Share on other sites
Combined matrices reduce the number of Multiplies and/or additions that need to be performed. This increases performance and is the very reason matrices are used for graphics.

To get a true understanding of the math optimizations behind matrices, do a little experiment on paper:

Create a set of coordinates that comprise a cube (call it C6
because there are six vertices to transform!)
Now come up with a view (V) and world (W) transform matrix.
Now do the calculations by hand...
C6*V=C6V produces 6 matrices, one for each vertex
C6V*W=C6VW produces 6 matrices, one for each vertex
Write down all the multiplies and additions.

Now calculate:
V*W=WV produces 1 matrix
C6*WV=C6VW produces 6 matrices, one for each vertex.

Just doing this mental exercise should let you see the savings... as the number of vertices increase, this technique because absolutely necessary.

For even further optimizations, check out quaternions.

-JR

1. 1
2. 2
Rutin
16
3. 3
4. 4
5. 5

• 26
• 11
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633705
• Total Posts
3013464
×