Merge pull request #4251 from jherico/master

Fixing bug in text renderer causing glyphs to float at different depths
This commit is contained in:
Brad Hefta-Gaub 2015-02-09 12:24:47 -08:00
commit 967b04af1a
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);
}