Thanks for the replies. Mew, you have a very nice quick reference! It mentions built-in uniforms that the orange book doesn't mention.
It is a pitty that ATI doesn't prioritize the OpenGL community high enough. I'm glad that I'm not writing a game application that should work on all hardware configurations. :) OT: AFAIK, amd as bought ATI. What is their strategy. Will their opengl driver support be improved? På Thu, 26 Jul 2007 12:07:12 +0200, skrev David Spilling <[EMAIL PROTECTED]>: > Although be a little wary... I have had problems (in the past, so I don't > know whether they are still there) with particular driver > implementations - > mainly ATI - not actually populating some of the GLSL required matrices, > which caused me no end of confusion > > I ended up just defining a set of uniforms in the application for the > matrices I wanted - annoying (as they had to be "manually" updated in > callbacks) but at least more driver proof. > > David > > On 24/07/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> >> > >> > Hi, >> > >> > In GLSL, a point is transformed from world-space to post-perspective >> > camera space like this: >> > >> > ftransform(); >> > OR >> > gl_ModelViewProjectionMatrix * gl_Vertex; >> > OR >> > gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex; >> > OR >> > gl_ProjectionMatrix * osg_ViewMatrix * gl_Vertex; >> > >> > It seems that the osg-provided uniform, osg_ViewMatrix, is equivalent >> with >> > gl_ModelViewMatrix. >> >> No, osg_ViewMatrix is just the view (ie camera) transformation, without >> the model transformation. gl_ModelViewMatrix is the standard OpenGL >> combined view+model transformation. >> >> >> > >> > What I am looking for is to transform a point from post-perspective >> space >> > to world-space. >> > >> > A document that I've read says that this is done by the following >> > equations: >> > >> > (I am using the ' symbol for denoting an inverse (^-1) ) >> > >> > Eq 1: >> > M_Projector = (M_View * M_Perspective)' >> > >> > If I have understood things correctly, this is the inverse of >> > ModelViewProjectionMatrix. (?) >> > >> > Eq 2: >> > p_world = M_Projector * p_projector >> > >> > M are the camera matrices. p is a point in homogenous >> three-dimensional >> > space. >> > >> > If (M_View * M_Perspective)' is the the inverse of >> > ModelViewProjectionMatrix it would be equivalent to, >> > osg_ViewMatrixInverse * gl_ProjectionMatrix', as B'A'=(AB)' . (?) >> > >> > osg_ViewMatrixInverse is provided by osg, so the only thing I have to >> do >> > is to calculate the inverse of gl_ProjectionMatrix. >> >> GLSL provides many of the built-in "gl_" matrices also as inverse, >> transpose, and inverse-transpose. See p45 of the 1.10 spec or the GLSL >> Quick Reference at mew.cx >> >> cheers >> -- mew >> >> >> > >> > Are there a more convenient way make this calculation? >> > >> > >> > >> > -- >> > Joakim Simonsson >> > _______________________________________________ >> > osg-users mailing list >> > [email protected] >> > >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> > >> >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> -- Joakim Simonsson _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

