Original Post
Hey all, I know a smiliar thread was started in the GP&T section, but I decided to post here because that one was marked "[RESOLVED]", and I was affraid that no one would bother to look at it. So basically, I have a GLSL shader that works on a quad list to build a bunch of screen facing particles. My problem is that that my rotation transforms don't seem to be right as everything goes to hell when I attempt to render. So far, I've tried the simple stuff like making sure my camPos is being set properly, and flipping the cross products. The thing is that this is the same look at code I use on the CPU, but it breaks on the GPU. Anyone see something I'm missing?
uniform float size;
uniform vec3 camPos;
void main()
{
//vec4 worldPos;
vec3 vAt = camPos - gl_Vertex.xyz;
vec3 vRight = cross( vec3( 0.0, 1.0, 0.0 ), vAt );
vec3 vUp = cross( vAt, vRight );
normalize( vAt );
normalize( vRight );
normalize( vUp );
//tex coords are used to store how the vert should be transformed
vec2 pos = gl_MultiTexCoord0.zw * vec2( size/2.0, size );
mat4 w = mat4( vec4( vRight, 0.0 ),
vec4( vUp, 0.0 ),
vec4( vAt, 0.0 ),
gl_Vertex );
gl_Position = gl_ModelViewProjectionMatrix * w * vec4( pos, 0.0, 1.0 );;
gl_TexCoord[0] = gl_MultiTexCoord0;
}