I've been struggling to get this working. I simply wish to take a surface normal and convert it to a screen angle.
As an example, assuming we're working with the highlighted surface on the sphere below, where the arrow is the normal, the 2D angle would obviously be PI/4 radians.
Here's one of the many things I've tried to no avail:
float4 A = v.vertex; float4 B = v.vertex + float4(v.normal, 0.0); A = mul(MVP, A); B = mul(MVP, B); A.xy /= A.w; B.xy /= B.w; o.theta = atan2(B.y - A.y, B.x - A.x);
I'm finally at my wit's end. Thanks for any and all help.