I'm not sure you can ATM. It doesn't look that way. If you can use the 3x3 part of a 4x4 in your shader that might be a workaround? Or send the matrix as 3 vec3fs and assemble them in the shader?
I agree it should be possible though, but that requires patching things a bit. Cheers, /Marcus Erik Podetti wrote: > I'm on the right way I think....How can I pass a 3x3 Matrix to the > shader by setUniformParameter....in the shader the parameter is a mat3 > but Opensg only create Matrix as 4x4.. > > 2008/12/1 Carsten Neumann <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> > > Hello Erik, > > Erik Podetti wrote: > > Hi everybody. > > I would like to know if it would be possible to extract or save > in any > > way the precomputed gl_NormalMatrix matrix from a shader. As I'm > > implementig a deferred shader I saved normals in world coordinate > and I > > need to transform them in eye-space (mgr->camera point of view) > inside a > > PolygonForeground shader (where the gl_NormalMatrix is obviously > > incoherent). > > > as Marcus already said, the gl_NormalMatrix is the transpose of the > inverse of the gl_ModelViewMatrix. It transforms normals from object to > eye space. You are saying that you store normals in world coordinates, > so what you need is the inverse transpose of the viewing matrix, to > transform the normals into eye space. > You get the viewing matrix from Camera::getViewing(). > > Hope it helps, > Carsten > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > <http://moblin-contest.org/redirect.php?banner_id=100&url=/> > _______________________________________________ > Opensg-users mailing list > [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > https://lists.sourceforge.net/lists/listinfo/opensg-users > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Opensg-users mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensg-users ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Opensg-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensg-users
