pcsx2/plugins/GSdx/res/interlace.h

93 lines
2.6 KiB
C
Raw Normal View History

/*
* Copyright (C) 2011-2013 Gregory hainaut
* Copyright (C) 2007-2009 Gabest
*
* This file was generated by glsl2h.pl script
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Make; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA USA.
* http://www.gnu.org/copyleft/gpl.html
*
*/
#pragma once
#include "stdafx.h"
extern const char* interlace_glsl =
"//#version 420 // Keep it for editor detection\n"
"\n"
"struct vertex_basic\n"
"{\n"
" vec4 p;\n"
" vec2 t;\n"
"};\n"
"\n"
"#ifdef FRAGMENT_SHADER\n"
"layout(location = 0) in vertex_basic PSin;\n"
"\n"
"layout(location = 0) out vec4 SV_Target0;\n"
"\n"
"#ifdef DISABLE_GL42\n"
"layout(std140) uniform cb11\n"
"#else\n"
"layout(std140, binding = 11) uniform cb11\n"
"#endif\n"
"{\n"
" vec2 ZrH;\n"
" float hH;\n"
"};\n"
"\n"
"layout(binding = 0) uniform sampler2D TextureSampler;\n"
"\n"
"// TODO ensure that clip (discard) is < 0 and not <= 0 ???\n"
"void ps_main0()\n"
"{\n"
" // I'm not sure it impact us but be safe to lookup texture before conditional if\n"
" // see: http://www.opengl.org/wiki/GLSL_Sampler#Non-uniform_flow_control\n"
" vec4 c = texture(TextureSampler, PSin.t);\n"
" if (fract(PSin.t.y * hH) - 0.5 < 0.0)\n"
" discard;\n"
"\n"
" SV_Target0 = c;\n"
"}\n"
"\n"
"void ps_main1()\n"
"{\n"
" // I'm not sure it impact us but be safe to lookup texture before conditional if\n"
" // see: http://www.opengl.org/wiki/GLSL_Sampler#Non-uniform_flow_control\n"
" vec4 c = texture(TextureSampler, PSin.t);\n"
" if (0.5 - fract(PSin.t.y * hH) < 0.0)\n"
" discard;\n"
"\n"
" SV_Target0 = c;\n"
"}\n"
"\n"
"void ps_main2()\n"
"{\n"
" vec4 c0 = texture(TextureSampler, PSin.t - ZrH);\n"
" vec4 c1 = texture(TextureSampler, PSin.t);\n"
" vec4 c2 = texture(TextureSampler, PSin.t + ZrH);\n"
"\n"
" SV_Target0 = (c0 + c1 * 2 + c2) / 4;\n"
"}\n"
"\n"
"void ps_main3()\n"
"{\n"
" SV_Target0 = texture(TextureSampler, PSin.t);\n"
"}\n"
"\n"
"#endif\n"
;