Remove the remaining bits of deprecated GL usage
The drawing is now completely shader based, which makes away with all usage of the depracted matrix stack. This also allows us to do things like simple translations and texture coordinate translation directly instead of doing everything indirectly through matrices. Fixed vertex attributes ('vertexPointer()' etc) are also replaced with user defined attribute arrays.
This commit is contained in:
parent
88c1489554
commit
9e63fb6b64
29 changed files with 701 additions and 295 deletions
|
@ -5,19 +5,18 @@ uniform vec4 tone;
|
|||
|
||||
uniform float opacity;
|
||||
uniform vec4 color;
|
||||
uniform vec4 flash;
|
||||
|
||||
uniform float bushDepth;
|
||||
uniform float bushOpacity;
|
||||
|
||||
uniform float bushOpacity;
|
||||
|
||||
varying vec2 v_texCoord;
|
||||
|
||||
const vec3 lumaF = { .299, .587, .114 };
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 coor = gl_TexCoord[0].xy;
|
||||
|
||||
/* Sample source color */
|
||||
vec4 frag = texture2D(texture, coor);
|
||||
vec4 frag = texture2D(texture, v_texCoord);
|
||||
|
||||
/* Apply gray */
|
||||
const float luma = dot(frag.rgb, lumaF);
|
||||
|
@ -32,11 +31,8 @@ void main()
|
|||
/* Apply color */
|
||||
frag.rgb = mix(frag.rgb, color.rgb, color.a);
|
||||
|
||||
/* Apply flash */
|
||||
frag.rgb = mix(frag.rgb, flash.rgb, flash.a);
|
||||
|
||||
/* Apply bush alpha by mathematical if */
|
||||
float underBush = float(coor.y < bushDepth);
|
||||
float underBush = float(v_texCoord.y < bushDepth);
|
||||
frag.a *= clamp(bushOpacity + underBush, 0, 1);
|
||||
|
||||
gl_FragColor = frag;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue