2022-06-25 10:06:45 +10:00
|
|
|
#version 450
|
|
|
|
|
|
|
|
/*
|
|
|
|
Mega Bezel - Creates a graphic treatment for the game play area to give a retro feel
|
2022-08-25 12:32:58 +10:00
|
|
|
Copyright (C) 2019-2022 HyperspaceMadness - HyperspaceMadness@outlook.com
|
2022-06-25 10:06:45 +10:00
|
|
|
|
|
|
|
Incorporates much great feedback from the libretro forum, and thanks
|
|
|
|
to Hunterk who helped me get started
|
|
|
|
|
|
|
|
See more at the libretro forum
|
|
|
|
https://forums.libretro.com/t/hsm-mega-bezel-reflection-shader-feedback-and-updates
|
|
|
|
|
|
|
|
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 3 of the License, 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 this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2022-08-25 12:32:58 +10:00
|
|
|
#include "common/globals-and-screen-scale-params.inc"
|
2022-10-11 07:26:21 +11:00
|
|
|
#include "common/common-functions.inc"
|
2022-06-25 10:06:45 +10:00
|
|
|
#pragma stage vertex
|
|
|
|
layout(location = 0) in vec4 Position;
|
|
|
|
layout(location = 1) in vec2 TexCoord;
|
|
|
|
layout(location = 0) out vec2 vTexCoord;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
gl_Position = global.MVP * Position;
|
|
|
|
vTexCoord = TexCoord;
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma stage fragment
|
|
|
|
layout(location = 0) in vec2 vTexCoord;
|
|
|
|
layout(location = 0) out vec4 FragColor;
|
|
|
|
layout(set = 0, binding = 2) uniform sampler2D Source;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
FragColor = HSM_Delinearize(texture(Source, vTexCoord), HSM_GAMMA_OUT_CRT);
|
|
|
|
}
|