2020-02-05 00:50:13 -05:00
|
|
|
#version 330
|
|
|
|
|
|
|
|
// pathfinder/shaders/tile_solid.vs.glsl
|
2019-01-14 22:32:53 -05:00
|
|
|
//
|
2019-01-15 14:42:25 -05:00
|
|
|
// Copyright © 2019 The Pathfinder Project Developers.
|
2019-01-14 22:32:53 -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.
|
|
|
|
|
2020-02-05 00:50:13 -05:00
|
|
|
precision highp float;
|
|
|
|
|
2019-06-25 14:32:39 -04:00
|
|
|
uniform mat4 uTransform;
|
2019-01-14 22:32:53 -05:00
|
|
|
uniform vec2 uTileSize;
|
|
|
|
|
2019-06-05 17:35:46 -04:00
|
|
|
in uvec2 aTessCoord;
|
|
|
|
in ivec2 aTileOrigin;
|
2020-02-05 16:59:32 -05:00
|
|
|
in vec4 aColorTexMatrix;
|
|
|
|
in vec2 aColorTexOffset;
|
2019-01-14 22:32:53 -05:00
|
|
|
|
2020-02-05 00:50:13 -05:00
|
|
|
out vec2 vColorTexCoord;
|
2019-01-15 13:52:37 -05:00
|
|
|
|
2020-02-05 00:50:13 -05:00
|
|
|
void main() {
|
2020-02-05 16:59:32 -05:00
|
|
|
vec2 tileOffset = vec2(aTessCoord) * uTileSize;
|
|
|
|
vec2 position = aTileOrigin * uTileSize + tileOffset;
|
|
|
|
vColorTexCoord = mat2(aColorTexMatrix) * tileOffset + aColorTexOffset;
|
2019-06-25 14:32:39 -04:00
|
|
|
gl_Position = uTransform * vec4(position, 0.0, 1.0);
|
2019-01-14 22:32:53 -05:00
|
|
|
}
|