PDA

View Full Version : GPU or CPU for Matrix Operations?

Antorian
11-18-2003, 02:11 AM
I'm designing an app' wich compute relative world from camera position.
So I need performance to extract the 3 vectors of camera world (View Direction,Up Direction, And Right Hand) in world coordinates.
My question is: what is the best way to get those vectors (I'm also Using gluLookAt routine to set up Camera, so I've already the View Axis) from the ModelView and Projection Matrix?

On the other Hand what is the fatest way to do the same with VertexProgram (ARB)?

All suggestions are welcome.

I would like to test performances of two solutions, such a way that I can suggest a CPU minimum requirement that is better than GPU operation (Or may be CPU is never better than VP operations).

Regards, Antorian.

Relic
11-18-2003, 04:33 AM
Find the source of gluLookAt?
To calculate two missing vectors, don't even think about OpenGL, just do it with a simple matrix multiplication.
You cant do the same with a vertex program, because it doesn't have another output possibility than the color buffer.
But maybe I didn't get the problem...

[This message has been edited by Relic (edited 11-18-2003).]

Ysaneya
11-18-2003, 07:17 AM
So I need performance to extract the 3 vectors of camera world (View Direction,Up Direction, And Right Hand) in world coordinates.

Why do you need performance ? It doesn't sound like something you'd do millions of times per second..

Y.

Antorian
11-21-2003, 10:23 AM
I tried with gluLookAt algorithm and it looks fine.
I wad in need of performance for axis extraction to simulate a chaos artifact, just after a "slow-shot" for light.
I mean with slow-shot , the effect you can have when taking a long shot on a busy highway during night (red & white lights are like rays).
So I can understand it sounds crazy... but it works http://www.opengl.org/discussion_boards/ubb/smile.gif
(Ok, I think it's not the best way to do that...)

Thanks.

So I think it's not necessary to use OpenGL, but I've tried to do rendering & computing in one pass.(In my new opinion a big mistake).

Regards. http://www.opengl.org/discussion_boards/ubb/smile.gif