2019-06-05 20:20:12 -04:00
|
|
|
#version 330
|
2019-02-04 19:04:13 -05:00
|
|
|
|
2020-03-02 23:04:09 -05:00
|
|
|
// pathfinder/shaders/blit.vs.glsl
|
2019-02-04 19:04:13 -05:00
|
|
|
//
|
2020-02-20 17:22:07 -05:00
|
|
|
// Copyright © 2020 The Pathfinder Project Developers.
|
2019-02-04 19:04:13 -05:00
|
|
|
//
|
|
|
|
// 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-02-04 19:04:13 -05:00
|
|
|
|
2020-06-23 15:48:35 -04:00
|
|
|
uniform vec4 uDestRect;
|
|
|
|
uniform vec2 uFramebufferSize;
|
|
|
|
|
2020-03-19 19:44:45 -04:00
|
|
|
in ivec2 aPosition;
|
2019-02-04 19:04:13 -05:00
|
|
|
|
|
|
|
out vec2 vTexCoord;
|
|
|
|
|
|
|
|
void main() {
|
2020-06-23 15:48:35 -04:00
|
|
|
vec2 position = mix(uDestRect.xy, uDestRect.zw, vec2(aPosition)) / uFramebufferSize;
|
2020-03-19 19:44:45 -04:00
|
|
|
vec2 texCoord = vec2(aPosition);
|
|
|
|
vTexCoord = texCoord;
|
2020-06-23 15:48:35 -04:00
|
|
|
gl_Position = vec4(mix(vec2(-1.0), vec2(1.0), position), 0.0, 1.0);
|
2019-02-04 19:04:13 -05:00
|
|
|
}
|