summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar wwylele2017-08-21 12:03:38 +0300
committerGravatar wwylele2017-08-22 09:34:44 +0300
commit17c6104d2afda7bf354c454f87561a3dbdf524e3 (patch)
treeeb511786edb2242912ddb054ff8e0be0e7cc4ea1
parentSwRasterizer/Lighting: implement LUT input CP (diff)
downloadyuzu-17c6104d2afda7bf354c454f87561a3dbdf524e3.tar.gz
yuzu-17c6104d2afda7bf354c454f87561a3dbdf524e3.tar.xz
yuzu-17c6104d2afda7bf354c454f87561a3dbdf524e3.zip
gl_rasterizer/lighting: more accurate CP formula
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_gen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp
index ae67aab05..d85f281e5 100644
--- a/src/video_core/renderer_opengl/gl_shader_gen.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp
@@ -594,8 +594,8 @@ static void WriteLighting(std::string& out, const PicaShaderConfig& config) {
594 // Note: even if the normal vector is modified by normal map, which is not the 594 // Note: even if the normal vector is modified by normal map, which is not the
595 // normal of the tangent plane anymore, the half angle vector is still projected 595 // normal of the tangent plane anymore, the half angle vector is still projected
596 // using the modified normal vector. 596 // using the modified normal vector.
597 std::string half_angle_proj = "normalize(half_vector) - normal / dot(normal, " 597 std::string half_angle_proj =
598 "normal) * dot(normal, normalize(half_vector))"; 598 "normalize(half_vector) - normal * dot(normal, normalize(half_vector))";
599 // Note: the half angle vector projection is confirmed not normalized before the dot 599 // Note: the half angle vector projection is confirmed not normalized before the dot
600 // product. The result is in fact not cos(phi) as the name suggested. 600 // product. The result is in fact not cos(phi) as the name suggested.
601 index = "dot(" + half_angle_proj + ", tangent)"; 601 index = "dot(" + half_angle_proj + ", tangent)";