float3 nor = normalize(input.wnor);
float phi = acos(nor.y);
float len = sin(phi);
float the = acos(nor.x / len);
最後改成這樣就搞定了:
float the = acos(clamp(nor.x / len, -1.0f, 1.0f));
float3 nor = normalize(input.wnor);
float phi = acos(nor.y);
float len = sin(phi);
float the = acos(nor.x / len);
float the = acos(clamp(nor.x / len, -1.0f, 1.0f));
No comments:
Post a Comment