comparison shaders/default.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 fa9ae059e4d3
children
comparison
equal deleted inserted replaced
1976:3dd9c68472fb 1977:f3cca4b3f17a
1 1
2 attribute vec2 pos; 2 attribute vec2 pos;
3 varying mediump vec2 texcoord; 3 varying mediump vec2 texcoord;
4 uniform mediump float width, height; 4 uniform mediump float width, height;
5 uniform mediump vec2 texsize;
5 6
6 void main() 7 void main()
7 { 8 {
8 gl_Position = vec4(pos, 0.0, 1.0); 9 gl_Position = vec4(pos, 0.0, 1.0);
9 texcoord = sign(pos) * vec2(width / 1024.0, height / -1024.0) + vec2(width / 1024.0, height / 1024.0); 10 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);
10 } 11 }