drawing one centered quad
This commit is contained in:
1 parent
e43f1bfa16
commit
a0bf1f8e4d
3 files changed
+25
-35
No files matched your search
@@ -1,8 +1,7 @@
|
||||
|
||||
varying vec2 tex_coord_i;
|
||||
uniform sampler2D tex;
|
||||
varying vec2 pos_2d_i;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = texture2D(tex, tex_coord_i);
|
||||
gl_FragColor = vec4(0, 0.3, 1, 1);
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
|
||||
uniform mat4 projection;
|
||||
uniform mat4 modelview;
|
||||
attribute vec3 pos;
|
||||
attribute vec2 tex_coord;
|
||||
varying vec2 tex_coord_i;
|
||||
uniform vec2 offset;
|
||||
|
||||
attribute vec2 pos;
|
||||
|
||||
varying vec2 pos_2d_i;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection * modelview * vec4(pos, 1);
|
||||
tex_coord_i = tex_coord;
|
||||
gl_Position = projection *
|
||||
(modelview * vec4(pos, 0, 1) + vec4(offset, 0, 1));
|
||||
pos_2d_i = pos + offset;
|
||||
}
|
||||
Reference in new issue
Block a user