-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcut2_pass_0.vert.glsl
58 lines (54 loc) · 2.01 KB
/
cut2_pass_0.vert.glsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Cheap Upscaling Triangulation
*
* Copyright (c) Filippo Scognamiglio 2024
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifdef GL_FRAGMENT_PRECISION_HIGH
#define HIGHP highp
#else
#define HIGHP mediump
precision mediump float;
#endif
uniform HIGHP vec2 textureSize;
varying HIGHP vec2 c01;
varying HIGHP vec2 c02;
varying HIGHP vec2 c04;
varying HIGHP vec2 c05;
varying HIGHP vec2 c06;
varying HIGHP vec2 c07;
varying HIGHP vec2 c08;
varying HIGHP vec2 c09;
varying HIGHP vec2 c10;
varying HIGHP vec2 c11;
varying HIGHP vec2 c13;
varying HIGHP vec2 c14;
void main() {
HIGHP vec2 coords = uv * 1.00006103515625;
HIGHP vec2 screenCoords = coords * textureSize - vec2(0.5);
c01 = (screenCoords + vec2(+0.0, -1.0)) / textureSize;
c02 = (screenCoords + vec2(+1.0, -1.0)) / textureSize;
c04 = (screenCoords + vec2(-1.0, +0.0)) / textureSize;
c05 = (screenCoords + vec2(+0.0, +0.0)) / textureSize;
c06 = (screenCoords + vec2(+1.0, +0.0)) / textureSize;
c07 = (screenCoords + vec2(+2.0, +0.0)) / textureSize;
c08 = (screenCoords + vec2(-1.0, +1.0)) / textureSize;
c09 = (screenCoords + vec2(+0.0, +1.0)) / textureSize;
c10 = (screenCoords + vec2(+1.0, +1.0)) / textureSize;
c11 = (screenCoords + vec2(+2.0, +1.0)) / textureSize;
c13 = (screenCoords + vec2(+0.0, +2.0)) / textureSize;
c14 = (screenCoords + vec2(+1.0, +2.0)) / textureSize;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}