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
|
@ -1,4 +1,3 @@
|
|||
|
||||
/* Fragment shader dealing with transitions */
|
||||
|
||||
uniform sampler2D currentScene;
|
||||
|
@ -9,15 +8,16 @@ uniform float prog;
|
|||
/* Vague [0, 512] normalized */
|
||||
uniform float vague;
|
||||
|
||||
varying vec2 v_texCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 texCoor = gl_TexCoord[0].st;
|
||||
float transV = texture2D(transMap, texCoor).r;
|
||||
float transV = texture2D(transMap, v_texCoord).r;
|
||||
float cTransV = clamp(transV, prog, prog+vague);
|
||||
float alpha = (cTransV - prog) / vague;
|
||||
|
||||
vec4 newFrag = texture2D(currentScene, texCoor);
|
||||
vec4 oldFrag = texture2D(frozenScene, texCoor);
|
||||
vec4 newFrag = texture2D(currentScene, v_texCoord);
|
||||
vec4 oldFrag = texture2D(frozenScene, v_texCoord);
|
||||
|
||||
gl_FragColor = mix(newFrag, oldFrag, alpha);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue