Archived

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

FERNANDO-BRASIL

An other way using glLoadMatrix

Recommended Posts

Guest Anonymous Poster   
Guest Anonymous Poster
> Does anyone knows how to access the current MATRIX directly from memory

You can''t access it directly from memory, since it is stored *in* the 3D card, in some register stack of the GPU. You have to query it, and that''s slow.

Share this post


Link to post
Share on other sites
NaliXL    120
Maybe some low-level (assembler?) code that directley acesses video mem would do the trick, although I''m absolutely not sure. Probably the NT/2000/XP HAL would block that too...

Share this post


Link to post
Share on other sites
davepermen    1047
oki.. in some implementations its somewhere in the driver means in system memory like a normal float matrix[16];
in some its in videomem or something
and in t&l cards its in the hardware in some registers..
first two are accessible, second is slow to access
third is not possible to access

and, never forget.. opengl and direct-x are designed to ABSTRACT the interfaces to give functionallity over different hardware.. opengl NEVER gives direct access to anything. dx does (but not the matrix) but with unwanted result: lock of the whole hardware..

we wanna play, not watch the pictures

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
As the other Anon Poster pointed out, , The matrix is stored on the GPU of the graphics card, querying for it is a performance hit regardless if you do it through assembly or otherwise.

Share this post


Link to post
Share on other sites
Huuumm thank you very mutch guys!!!

I understood the case!

Huum, but how Can I Discover and Access this Interrupt using Assembler??

I Have no idea how works the 32-bit Assembler (I''ve never tried doing things), but I''ve already work with ASM 16 bit for DOS.

Thank you again!

Share this post


Link to post
Share on other sites
Thank you Elber, But it isn''t exactly what I want.

Using glGetDoublev(GL_MODELVIEW_MATRIX, matrix), I''ll have to put the changed matrix as the current all the times (with glLoadMatrix).

And this, is what I''m doing now.

I have a Matrix, that stores my values (matrix[16]), and I''m doing rotations by hand, and after of each rotation, I use the glLoadMatrix to put the matrix as the current matrix.

But, in my mind, it''s too easy for repeating this same things all the time...

Then, I would like to know, if there is a way to access the current matrix directly, without having to copy, to change and after to load it.

thanks again !! :-)

Share this post


Link to post
Share on other sites
zedzeek    528
>>As the other Anon Poster pointed out, , The matrix is stored on the GPU of the graphics card, querying for it is a performance hit regardless if you do it through assembly or otherwise. <<

no its not with *ALL* opengl implementations from the high to the low this info is pulled from client side with glGet..( ..MATRIX ), ie from the cpu + not the card

confused by the original posters intenetion

>>Then, I would like to know, if there is a way to access the current matrix directly, without having to copy, to change and after to load it.<<

if u go glLoadMatrix( M1 ) the current matrix is M1.
loadmatrix will replace the current matrix completely


http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
Yeaaaa Zedzeek! I think you didn''t understand what I have been asking... Because you wrote:

"if u go glLoadMatrix( M1 ) the current matrix is M1.
loadmatrix will replace the current matrix completely"

I know that, and I''ve commented this in my last message. What i want, is not to use glLoadMatrix to replace the current Matrix.

I want to use, for example, M1 pointing directly to the memory (as the current matrix).

Because I think it should be fasten, I don''t know.

Thank you again.

Share this post


Link to post
Share on other sites
Ysaneya    1383
Unless you are loading one million of matrices every frame, i doubt you''ll see a single nanosecond of difference. It''s even more true with T&L.

I''d suggest that you profile your code and find out the real bottleneck of your application, rather than trying to improve something that''s most likely not slowing you down

Y.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
> I want to use, for example, M1 pointing directly to the memory (as the current matrix).

This won''t work, since (as pointed out above), the matrix resides on the GPU, it''s not in normal address space.

Share this post


Link to post
Share on other sites