Skip to content

Commit

Permalink
shaders: Fix last commit.
Browse files Browse the repository at this point in the history
Rename ‘rect’ to ‘vertex’, to make sure that the attribute always gets location 0.
  • Loading branch information
Cyp committed Apr 5, 2017
1 parent 4134f82 commit 871fa31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions data/base/shaders/line.vert
Expand Up @@ -4,11 +4,11 @@ uniform vec2 from;
uniform vec2 to;
uniform mat4 ModelViewProjectionMatrix;

attribute vec4 rect;
attribute vec4 vertex;


void main()
{
vec4 pos = vec4(from + (to - from)*rect.y, 0.0, 1.0);
vec4 pos = vec4(from + (to - from)*vertex.y, 0.0, 1.0);
gl_Position = ModelViewProjectionMatrix * pos;
}
6 changes: 3 additions & 3 deletions data/base/shaders/rect.vert
Expand Up @@ -12,13 +12,13 @@ uniform mat4 transformationMatrix;
uniform vec2 tuv_offset;
uniform vec2 tuv_scale;

attribute vec4 rect;
attribute vec4 vertex;

varying vec2 uv;


void main()
{
gl_Position = transformationMatrix * rect;
uv = tuv_scale * rect.xy + tuv_offset;
gl_Position = transformationMatrix * vertex;
uv = tuv_scale * vertex.xy + tuv_offset;
}

0 comments on commit 871fa31

Please sign in to comment.