Hi, I'm trying to implement cone-step mapping shader in QC, and I got this problem: the GLSL vertex shader needs to know the tangent of each vertex. As far as I know, GLSL lets to access to the per-vertex normal value using the built-in attribute gl_Normal, but the tangent of each vertex needs to be passed from the OpenGL application (calculated when the mesh is loaded for example), or stored in the mesh file. So, i guess the right way to do that is to use per-vertex attribute like this in vertex shader:
[...] attribute vec3 tangent; //The tangent of the current vertex [...] ...but how can this attribute be passed to the GLSL shader for each vertex? I also need per-vertex binormal value, but I guess it would be ok to calculculate its value once I got per-vertex normal and tangent values in this way: binormal = normalize(cross(normal, tangent)); Thank you for any kind of help!
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com This email sent to [email protected]

