summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-11-26 02:30:27 +0100
committerbunnei <bunneidev@gmail.com>2016-02-05 23:20:17 +0100
commit449902b5583d6a2dbb1e4aea9802da5ad2493981 (patch)
treede843ac8fb02db3d909a2ecf399c545b8a3ff569 /src/video_core/renderer_opengl
parentgl_shader_gen: Implement lighting red, green, and blue reflection. (diff)
downloadyuzu-449902b5583d6a2dbb1e4aea9802da5ad2493981.tar
yuzu-449902b5583d6a2dbb1e4aea9802da5ad2493981.tar.gz
yuzu-449902b5583d6a2dbb1e4aea9802da5ad2493981.tar.bz2
yuzu-449902b5583d6a2dbb1e4aea9802da5ad2493981.tar.lz
yuzu-449902b5583d6a2dbb1e4aea9802da5ad2493981.tar.xz
yuzu-449902b5583d6a2dbb1e4aea9802da5ad2493981.tar.zst
yuzu-449902b5583d6a2dbb1e4aea9802da5ad2493981.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_gen.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp
index 984aef586..d59f2054b 100644
--- a/src/video_core/renderer_opengl/gl_shader_gen.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp
@@ -362,11 +362,11 @@ static void WriteLighting(std::string& out, const PicaShaderConfig& config) {
if (abs) {
// LUT index is in the range of (0.0, 1.0)
index = config.lighting.light[light_num].two_sided_diffuse ? "abs(" + index + ")" : "max(" + index + ", 0.f)";
- return "clamp(" + index + ", 0.0, FLOAT_255)";
+ return "(FLOAT_255 * clamp(" + index + ", 0.0, 1.0))";
} else {
// LUT index is in the range of (-1.0, 1.0)
index = "clamp(" + index + ", -1.0, 1.0)";
- return "clamp(((" + index + " < 0) ? " + index + " + 2.0 : " + index + ") / 2.0, 0.0, FLOAT_255)";
+ return "(FLOAT_255 * ((" + index + " < 0) ? " + index + " + 2.0 : " + index + ") / 2.0)";
}
return std::string();
@@ -487,7 +487,7 @@ std::string GenerateFragmentShader(const PicaShaderConfig& config) {
#define NUM_TEV_STAGES 6
#define NUM_LIGHTS 8
#define LIGHTING_LUT_SIZE 256
-#define FLOAT_255 0.99609375
+#define FLOAT_255 (255.0 / 256.0)
in vec4 primary_color;
in vec2 texcoord[3];