annotate shaders/crt.v.glsl @ 1977:f3cca4b3f17a

Allow use of NPOT textures as a config option. Useful for some mobile GPUs
author Michael Pavone <pavone@retrodev.com>
date Sat, 09 May 2020 21:15:33 -0700
parents 4942da159194
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1392
4942da159194 Added a "subtle" CRT shader contributed by Anael Seghezzi
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
1
4942da159194 Added a "subtle" CRT shader contributed by Anael Seghezzi
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
2 attribute vec2 pos;
1977
f3cca4b3f17a Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents: 1392
diff changeset
3 varying mediump vec2 texcoord;
f3cca4b3f17a Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents: 1392
diff changeset
4 varying mediump vec2 screencoord;
f3cca4b3f17a Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents: 1392
diff changeset
5 uniform mediump float width, height;
f3cca4b3f17a Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents: 1392
diff changeset
6 uniform mediump vec2 texsize;
1392
4942da159194 Added a "subtle" CRT shader contributed by Anael Seghezzi
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
7
4942da159194 Added a "subtle" CRT shader contributed by Anael Seghezzi
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
8 void main()
4942da159194 Added a "subtle" CRT shader contributed by Anael Seghezzi
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
9 {
4942da159194 Added a "subtle" CRT shader contributed by Anael Seghezzi
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
10 gl_Position = vec4(pos, 0.0, 1.0);
1977
f3cca4b3f17a Allow use of NPOT textures as a config option. Useful for some mobile GPUs
Michael Pavone <pavone@retrodev.com>
parents: 1392
diff changeset
11 texcoord = sign(pos) * vec2(0.5*width/texsize.x, -0.5*height/texsize.y) + vec2(0.5*width/texsize.x, 0.5*height/texsize.y);
1392
4942da159194 Added a "subtle" CRT shader contributed by Anael Seghezzi
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
12 screencoord = sign(pos);
4942da159194 Added a "subtle" CRT shader contributed by Anael Seghezzi
Michael Pavone <pavone@retrodev.com>
parents:
diff changeset
13 }