pathfinder/shaders/gles2/blit.vs.glsl

34 lines
951 B
Plaintext
Raw Normal View History

2017-08-15 18:57:52 -04:00
// pathfinder/shaders/gles2/blit.vs.glsl
//
// Copyright (c) 2017 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.
2017-08-15 18:57:52 -04:00
2017-12-28 11:46:44 -05:00
//! A trivial shader that does nothing more than blit a texture.
2017-10-26 23:30:47 -04:00
precision mediump float;
2017-10-26 23:30:47 -04:00
/// A 3D transform to apply to the scene.
uniform mat4 uTransform;
2017-12-28 11:46:44 -05:00
/// A pair of fixed scale factors to be applied to the texture coordinates.
uniform vec2 uTexScale;
2017-08-15 18:57:52 -04:00
2017-10-26 23:30:47 -04:00
/// The 2D vertex position.
2017-08-15 18:57:52 -04:00
attribute vec2 aPosition;
2017-12-28 11:46:44 -05:00
2017-10-26 23:30:47 -04:00
/// The texture coordinate.
2017-08-15 18:57:52 -04:00
attribute vec2 aTexCoord;
2017-12-28 11:46:44 -05:00
/// The outgoing texture coordinate.
2017-08-15 18:57:52 -04:00
varying vec2 vTexCoord;
void main() {
gl_Position = uTransform * vec4(aPosition, 0.0, 1.0);
vTexCoord = aTexCoord * uTexScale;
2017-08-15 18:57:52 -04:00
}