diff --git a/src/video_core/host_shaders/opengl_present.frag b/src/video_core/host_shaders/opengl_present.frag index d17b8c177..4e10dddde 100644 --- a/src/video_core/host_shaders/opengl_present.frag +++ b/src/video_core/host_shaders/opengl_present.frag @@ -21,9 +21,9 @@ vec3 LinearTosRGB(vec3 c) { void main() { vec4 pixel = texture(color_texture, frag_tex_coord); - if (convert_colors == 1){ + if (convert_colors == 2){ pixel = vec4(LinearTosRGB(pixel.rgb), pixel.a); - } else if (convert_colors == 2){ + } else if (convert_colors == 1){ pixel = vec4(sRGBToLinear(pixel.rgb), pixel.a); } color = pixel; diff --git a/src/video_core/host_shaders/opengl_simple_present.frag b/src/video_core/host_shaders/opengl_simple_present.frag index d17b8c177..4e10dddde 100644 --- a/src/video_core/host_shaders/opengl_simple_present.frag +++ b/src/video_core/host_shaders/opengl_simple_present.frag @@ -21,9 +21,9 @@ vec3 LinearTosRGB(vec3 c) { void main() { vec4 pixel = texture(color_texture, frag_tex_coord); - if (convert_colors == 1){ + if (convert_colors == 2){ pixel = vec4(LinearTosRGB(pixel.rgb), pixel.a); - } else if (convert_colors == 2){ + } else if (convert_colors == 1){ pixel = vec4(sRGBToLinear(pixel.rgb), pixel.a); } color = pixel; diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 4edcd3f82..f61c0d1e7 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -611,17 +611,24 @@ void RendererOpenGL::DrawSingleScreen(const ScreenInfo& screen_info, float scree state.texture_units[0].sampler = sampler; state.Apply(); - /* TODO: - Implement Two Pass Gamma Corrected Linear Filtering - Create A Shader for initial rotation that'll be used for everything + Implement Gamma Corrected Linear Filtering + use Simple Present Shader with landscape_rotation_vertices and convert_colors set to 1 + use Regular Present Shader with output_vertices and convert_colors set to 2 - Then do: - initial rotation shader -> opengl_present shader (and all the variants) + Implement FXAA: + use Simple Present Shader with landscape_rotation_vertices and convert_colors set to 0 + use FXAA shader with pass_through_vertices + use Simple Present Shader with pass_through_vertices and convert colors set to 1 + use Regular Present Shader with output_vertices and convert_colors set to 2 - simple present is used for internal textures. It uses ndc coordinates directly - present is used for final mapping to screen. It uses screen coordinates, and transforms it accordingly + Implement SMAA: + use Simple Present Shader with landscape_rotation_vertices and convert_colors set to 1 + use SMAA pass 1 with pass_through_vertices + use SMAA pass 2 with pass_through_vertices + use SMAA pass 3 with pass_through_vertices + use Regular Present Shader with output_vertices and convert_colors set to 2 */ GLuint old_read_fb = state.draw.read_framebuffer; diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 413f26349..9ac9268dc 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -102,7 +102,7 @@ private: GLuint uniform_color_texture; GLuint uniform_color_texture_r; - // Shader Uniform for converting colors. 0 is no conversion, 1 is Linear -> sRGB, 2 is sRGB -> linear + // Shader Uniform for converting colors. 0 is no conversion, 1 is sRGB -> linear, 2 is Linear -> sRGB GLuint uniform_convert_colors; // Shader uniform for Dolphin compatibility