2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

gl_rasterizer/lighting: more accurate CP formula

This commit is contained in:
wwylele 2017-08-21 12:03:38 +03:00
parent b5aa570354
commit 17c6104d2a

View file

@ -594,8 +594,8 @@ static void WriteLighting(std::string& out, const PicaShaderConfig& config) {
// Note: even if the normal vector is modified by normal map, which is not the // Note: even if the normal vector is modified by normal map, which is not the
// normal of the tangent plane anymore, the half angle vector is still projected // normal of the tangent plane anymore, the half angle vector is still projected
// using the modified normal vector. // using the modified normal vector.
std::string half_angle_proj = "normalize(half_vector) - normal / dot(normal, " std::string half_angle_proj =
"normal) * dot(normal, normalize(half_vector))"; "normalize(half_vector) - normal * dot(normal, normalize(half_vector))";
// Note: the half angle vector projection is confirmed not normalized before the dot // Note: the half angle vector projection is confirmed not normalized before the dot
// product. The result is in fact not cos(phi) as the name suggested. // product. The result is in fact not cos(phi) as the name suggested.
index = "dot(" + half_angle_proj + ", tangent)"; index = "dot(" + half_angle_proj + ", tangent)";