RetroArch-Wii-U-Slang-Shaders/test/feedback.frag
2020-04-26 18:03:54 -05:00

27 lines
596 B
GLSL

#version 150
#define float2 vec2
#define float3 vec3
#define float4 vec4
layout(std140) uniform UBO
{
mat4 MVP;
vec4 SourceSize;
vec4 PassFeedbackSize0;
}global;
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
uniform sampler2D Source;
uniform sampler2D PassFeedback0;
void main()
{
vec2 tex = floor(global . PassFeedbackSize0 . xy * vTexCoord);
tex =(tex + 0.5)* global . PassFeedbackSize0 . zw;
vec3 current = texture(Source, tex). rgb;
vec3 prev = texture(PassFeedback0, tex). rgb;
FragColor = vec4(mix(current, prev, 0.8), 1.0);
}