diff options
author | wwylele <wwylele@gmail.com> | 2017-06-22 16:22:45 +0200 |
---|---|---|
committer | wwylele <wwylele@gmail.com> | 2017-06-22 19:41:00 +0200 |
commit | 8978ecb09caa91424b7117a91d22e7f54040e701 (patch) | |
tree | 65fd8428d562473c9dbd2f7263de1f49898841a2 /src/video_core/renderer_opengl/gl_shader_gen.cpp | |
parent | gl_rasterizer: create the texture before applying the state (diff) | |
download | yuzu-8978ecb09caa91424b7117a91d22e7f54040e701.tar yuzu-8978ecb09caa91424b7117a91d22e7f54040e701.tar.gz yuzu-8978ecb09caa91424b7117a91d22e7f54040e701.tar.bz2 yuzu-8978ecb09caa91424b7117a91d22e7f54040e701.tar.lz yuzu-8978ecb09caa91424b7117a91d22e7f54040e701.tar.xz yuzu-8978ecb09caa91424b7117a91d22e7f54040e701.tar.zst yuzu-8978ecb09caa91424b7117a91d22e7f54040e701.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_gen.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_gen.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 0c7c4dd5c..c93b108fb 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -1052,7 +1052,7 @@ layout (std140) uniform shader_data { uniform sampler2D tex[3]; uniform samplerBuffer lighting_lut; -uniform usampler1D fog_lut; +uniform samplerBuffer fog_lut; uniform sampler1D proctex_noise_lut; uniform sampler1D proctex_color_map; uniform sampler1D proctex_alpha_map; @@ -1145,12 +1145,8 @@ vec4 secondary_fragment_color = vec4(0.0); // Generate clamped fog factor from LUT for given fog index out += "float fog_i = clamp(floor(fog_index), 0.0, 127.0);\n"; out += "float fog_f = fog_index - fog_i;\n"; - out += "uint fog_lut_entry = texelFetch(fog_lut, int(fog_i), 0).r;\n"; - out += "float fog_lut_entry_difference = float(int((fog_lut_entry & 0x1FFFU) << 19U) >> " - "19);\n"; // Extract signed difference - out += "float fog_lut_entry_value = float((fog_lut_entry >> 13U) & 0x7FFU);\n"; - out += "float fog_factor = (fog_lut_entry_value + fog_lut_entry_difference * fog_f) / " - "2047.0;\n"; + out += "vec2 fog_lut_entry = texelFetch(fog_lut, int(fog_i)).rg;\n"; + out += "float fog_factor = fog_lut_entry.r + fog_lut_entry.g * fog_f;\n"; out += "fog_factor = clamp(fog_factor, 0.0, 1.0);\n"; // Blend the fog |