|
|
|
@ -302,9 +302,11 @@ uniform vec4 o_resolution;
|
|
|
|
|
uniform sampler2D color_texture;
|
|
|
|
|
uniform sampler2D color_texture_r;
|
|
|
|
|
|
|
|
|
|
uniform int reverse_interlaced;
|
|
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
|
float screen_row = o_resolution.x * frag_tex_coord.x;
|
|
|
|
|
if (int(screen_row) % 2 == 0)
|
|
|
|
|
if (int(screen_row) % 2 == reverse_interlaced)
|
|
|
|
|
color = texture(color_texture, frag_tex_coord);
|
|
|
|
|
else
|
|
|
|
|
color = texture(color_texture_r, frag_tex_coord);
|
|
|
|
@ -692,7 +694,8 @@ void RendererOpenGL::ReloadShader() {
|
|
|
|
|
shader_data += shader_text;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if (Settings::values.render_3d == Settings::StereoRenderOption::Interlaced) {
|
|
|
|
|
} else if (Settings::values.render_3d == Settings::StereoRenderOption::Interlaced ||
|
|
|
|
|
Settings::values.render_3d == Settings::StereoRenderOption::ReverseInterlaced) {
|
|
|
|
|
if (Settings::values.pp_shader_name == "horizontal (builtin)") {
|
|
|
|
|
shader_data += fragment_shader_interlaced;
|
|
|
|
|
} else {
|
|
|
|
@ -725,9 +728,19 @@ void RendererOpenGL::ReloadShader() {
|
|
|
|
|
uniform_modelview_matrix = glGetUniformLocation(shader.handle, "modelview_matrix");
|
|
|
|
|
uniform_color_texture = glGetUniformLocation(shader.handle, "color_texture");
|
|
|
|
|
if (Settings::values.render_3d == Settings::StereoRenderOption::Anaglyph ||
|
|
|
|
|
Settings::values.render_3d == Settings::StereoRenderOption::Interlaced) {
|
|
|
|
|
Settings::values.render_3d == Settings::StereoRenderOption::Interlaced ||
|
|
|
|
|
Settings::values.render_3d == Settings::StereoRenderOption::ReverseInterlaced) {
|
|
|
|
|
uniform_color_texture_r = glGetUniformLocation(shader.handle, "color_texture_r");
|
|
|
|
|
}
|
|
|
|
|
if (Settings::values.render_3d == Settings::StereoRenderOption::Interlaced ||
|
|
|
|
|
Settings::values.render_3d == Settings::StereoRenderOption::ReverseInterlaced) {
|
|
|
|
|
GLuint uniform_reverse_interlaced =
|
|
|
|
|
glGetUniformLocation(shader.handle, "reverse_interlaced");
|
|
|
|
|
if (Settings::values.render_3d == Settings::StereoRenderOption::ReverseInterlaced)
|
|
|
|
|
glUniform1i(uniform_reverse_interlaced, 1);
|
|
|
|
|
else
|
|
|
|
|
glUniform1i(uniform_reverse_interlaced, 0);
|
|
|
|
|
}
|
|
|
|
|
uniform_i_resolution = glGetUniformLocation(shader.handle, "i_resolution");
|
|
|
|
|
uniform_o_resolution = glGetUniformLocation(shader.handle, "o_resolution");
|
|
|
|
|
uniform_layer = glGetUniformLocation(shader.handle, "layer");
|
|
|
|
@ -973,7 +986,8 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f
|
|
|
|
|
|
|
|
|
|
const bool stereo_single_screen =
|
|
|
|
|
Settings::values.render_3d == Settings::StereoRenderOption::Anaglyph ||
|
|
|
|
|
Settings::values.render_3d == Settings::StereoRenderOption::Interlaced;
|
|
|
|
|
Settings::values.render_3d == Settings::StereoRenderOption::Interlaced ||
|
|
|
|
|
Settings::values.render_3d == Settings::StereoRenderOption::ReverseInterlaced;
|
|
|
|
|
|
|
|
|
|
// Bind a second texture for the right eye if in Anaglyph mode
|
|
|
|
|
if (stereo_single_screen) {
|
|
|
|
|