Archived

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

Qoy

Bypass a matrix?

Recommended Posts

Qoy    127
Is there any way to disable the modelview matrix so that vertices you send to be rasterized are not multiplied by it? I have a situation where I want to transform the control points of a bicubic patch and tesselate it myself (not with OGL evalulators) and if possible, I would like OGL to not multiply the vertices I pass in after tesselation by the modelview matrix, as they''ll already be in the correct position. I know I can set it to the identity matrix, but then it will still multiply, which I want to avoid if possible. Thanks!

Share this post


Link to post
Share on other sites
masonium    118
if you set the identity matrix, the vertices won''t change. I''m pretty sure that the vertices are sent to OGL as matrices, and I know that any matrix multiplied by the identity matrix results in that matrix. But maybe I don''t understnd the question.

Share this post


Link to post
Share on other sites
Bad Monkey    145
I think a lot of of drivers now can recognise if you are multiplying by the identity matrix, and will shortcut it for you (or I may just be spinning bs again )

So i guess you could just go

glPushMatrix()
glLoadIdentity()

do your thang...

glPopMatrix()

somewhere in your render loop, and it may pick it up... it think that''s the only way you can do it... can''t escape the man etc

Share this post


Link to post
Share on other sites
Qoy    127
Thanks Bad Monkey, if that''s true then it''s cool

I know that the identity matrix will do what I want, and I''m using it now, but I was just wondering if there''s any way to let OGL totally bypass it, so each vertex won''t even be multiplied by the modelview matrix at all. When you''re tessellating curves, if you transform the control points and then tessellate it, it achieves the same effect as tessellating and transforming the tessellated points. Since there are only 16 control points, and a potentially large number of rendered vertices, I''m using my own matrix routines to transform the control points beforehand and then tessellate and render the vertices without a modelview transformation.

However, if the verts are still going to be multiplied by a matrix on rendering, then there''s really no point in transforming the control points at all, as that will just add 16 extra matrix operations and the per vertex transform will still be done.

So, does anybody else have any idea if you can disable the transformation?

Share this post


Link to post
Share on other sites