Added support for shaders written in non-legacy GLSL.

This commit is contained in:
binary1248 2018-05-20 14:06:24 +02:00
parent 1dcad60878
commit db7e683688
No known key found for this signature in database
GPG key ID: E5E52A5D6082224A
18 changed files with 690 additions and 74 deletions

View file

@ -2,9 +2,17 @@ uniform vec2 storm_position;
uniform float storm_total_radius;
uniform float storm_inner_radius;
attribute vec2 positionAttribute;
attribute vec4 colorAttribute;
uniform mat4 modelViewMatrix;
uniform mat4 projectionMatrix;
varying vec4 frontColor;
void main()
{
vec4 vertex = gl_ModelViewMatrix * gl_Vertex;
vec4 vertex = modelViewMatrix * vec4(positionAttribute, 0.0, 1.0);
vec2 offset = vertex.xy - storm_position;
float len = length(offset);
if (len < storm_total_radius)
@ -13,7 +21,6 @@ void main()
vertex.xy = storm_position + normalize(offset) * push_distance;
}
gl_Position = gl_ProjectionMatrix * vertex;
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
gl_FrontColor = gl_Color;
gl_Position = projectionMatrix * vertex;
frontColor = colorAttribute;
}