Archived

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

Poya

Hardware Matrix Operations?

Recommended Posts

Hello I''m confused about something and hope someone can give me a hint. Would I be correct to say that all vertex transformations are all done by hardware device? What about operations on a matrix? I ask this because I normally use my own matrix classes. I let the D3D or OpenGL pipeline do the vertex transformations, however for operations on a matrix (eg multiplying 2 matrices or rotation a matrix) I use my own code. Would this cause a significant performance hit over the long run? My other question : is there a way to get the transformed vertices from D3D or OpenGL pipeline. I need this because after rotating or animating a model, I must use the transformed vertices to calculate the new bounding box. Of course I can do the vertex tranformations in my own code, but as I mentioned before I don''t want to do this if there is a performance hit associated with it. Thanks

Share this post


Link to post
Share on other sites
You said you wanted a hint, ok

IDirect3DDevice8::MultiplyTransform
IDirect3DDevice8:rocessVertices
IDirect3DDevice8::DrawIndexedPrimitiveUP

Share this post


Link to post
Share on other sites
Anything that returns a value will not be calculated on the graphics card. The reason is that while the AGP bus is great for sending data to the card, it''s horrible for getting data from the card - that''s the main reason why things like glReadPixels() is so slow (the other is that it causes a pipeline stall, but that''s another matter). Any speedups gained from doing matrix multiplication in hardware would be lost in getting the data back from the card.

For that reason, you can''t get transformed vertices from the graphics pipeline. If you need the transformed vertices for your own use, your best bet is either writing your own methods, or using one of the libraries (i.e. D3DX). The advantages of using D3DX would be that it may be implemented with SSE or 3DNow! (I can''t confirm this in D3DX, but I''m sure others could).


codeka.com - Just click it.

Share this post


Link to post
Share on other sites