2019-06-05 20:20:12 -04:00
|
|
|
#version 330
|
2019-04-22 16:50:38 -04:00
|
|
|
|
2019-06-05 20:20:12 -04:00
|
|
|
// pathfinder/shaders/reproject.fs.glsl
|
2019-04-22 16:50:38 -04:00
|
|
|
//
|
|
|
|
// Copyright © 2019 The Pathfinder Project Developers.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
precision highp float;
|
2020-05-08 19:59:01 -04:00
|
|
|
|
|
|
|
#ifdef GL_ES
|
2020-03-27 17:53:00 -04:00
|
|
|
precision highp sampler2D;
|
2020-05-08 19:59:01 -04:00
|
|
|
#endif
|
2019-04-22 16:50:38 -04:00
|
|
|
|
|
|
|
uniform mat4 uOldTransform;
|
|
|
|
uniform sampler2D uTexture;
|
|
|
|
|
|
|
|
in vec2 vTexCoord;
|
|
|
|
|
|
|
|
out vec4 oFragColor;
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
vec4 normTexCoord = uOldTransform * vec4(vTexCoord, 0.0, 1.0);
|
|
|
|
vec2 texCoord = ((normTexCoord.xy / normTexCoord.w) + 1.0) * 0.5;
|
|
|
|
oFragColor = texture(uTexture, texCoord);
|
|
|
|
}
|