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).

Not extract or save in a simple way, AFAIK, but you can compute it from 
the modelviewmatrix, which is to-world + camera view matrix.

The definition of the normal matrix can be found in the OpenGL spec, 
IIRC it's the inverse of the transpose of the 3x3 upper matrix, or 
something like that. :)

Does that help?

Cheers,
/Marcus


-------------------------------------------------------------------------
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

Reply via email to