Fixing bug in text renderer causing glyphs to float at different depths

This commit is contained in:
Brad Davis 2015-02-08 15:37:55 -08:00
parent 6378009992
commit b28920f4ed
2 changed files with 3 additions and 3 deletions

View file

@ -345,7 +345,7 @@ void Font::setupGL() {
int posLoc = _program->attributeLocation("Position");
int texLoc = _program->attributeLocation("TexCoord");
glEnableVertexAttribArray(posLoc);
glVertexAttribPointer(posLoc, 3, GL_FLOAT, false, stride, nullptr);
glVertexAttribPointer(posLoc, 2, GL_FLOAT, false, stride, nullptr);
glEnableVertexAttribArray(texLoc);
glVertexAttribPointer(texLoc, 2, GL_FLOAT, false, stride, offset);
_vao->release();

View file

@ -13,12 +13,12 @@
uniform mat4 Projection;
uniform mat4 ModelView;
attribute vec3 Position;
attribute vec2 Position;
attribute vec2 TexCoord;
varying vec2 vTexCoord;
void main() {
vTexCoord = TexCoord;
gl_Position = Projection * ModelView * vec4(Position, 1.0);
gl_Position = Projection * ModelView * vec4(Position, 0.0, 1.0);
}