LWJGL Forum

Programming => OpenGL => Topic started by: majikchicken on April 28, 2016, 03:37:41

Title: What's causing this weird sporadic blur? (Text rendered through VBO)
Post by: majikchicken on April 28, 2016, 03:37:41
I literally just got my font/text rendering system to render text through a VBO, but I get this odd blur seemingly at random. It often obscures the text. What's causing this? I'm using LWJGL 3, so if you ask for code be prepared to read Java.

My VBO is interleaved, following the format : { r1, g1, b1, tx1, ty1, x1, y1, z1, r2, g2, b2, tx2, ty2, x2, y2, z2, ... } where 'r, g, b' are color codes (in floats), 'tx, ty' are texture coordinates (in floats), and 'x, y, z' are position vertices (in floats).

Here's an imgur album with screenshots of what's happening: http://imgur.com/a/BS9qH


Please help me diagnose the issue. Thanks!
Title: Re: What's causing this weird sporadic blur? (Text rendered through VBO)
Post by: Cornix on April 28, 2016, 09:17:14
Looks to me like you upload your data incorrectly. It seems like some vertices for the triangles are in the wrong order.

Alternatively:
I had a similar problem once with strange artifacts appearing on screen. It turned out to be a driver bug that was triggered by me uploading an incorrect number of vertices. I uploaded some additional garbage data with my original data and had the size and whatnot set incorrectly. (I cant remember in detail anymore)
The driver bug was that it should have generated an openGL error. Instead it didnt give any errors but produced this corrupt output.
Title: Re: What's causing this weird sporadic blur? (Text rendered through VBO)
Post by: majikchicken on April 29, 2016, 02:45:42
Quote from: Cornix on April 28, 2016, 09:17:14
Looks to me like you upload your data incorrectly. It seems like some vertices for the triangles are in the wrong order.

I'm using GL_QUADS instead of GL_TRIANGLES just to make my math easier.  Could this be the result of me using a deprecated function?
Title: Re: What's causing this weird sporadic blur? (Text rendered through VBO)
Post by: string111 on June 29, 2016, 00:06:59
If you are using LWJGL3, GL_QUADS are depreciated, this may cause your problem. Just define two GL_TRIANGELS. Be sure to update your set of vertices.
Title: Re: What's causing this weird sporadic blur? (Text rendered through VBO)
Post by: SilverTiger on June 29, 2016, 17:58:48
Quote from: string111 on June 29, 2016, 00:06:59
If you are using LWJGL3, GL_QUADS are depreciated, this may cause your problem. Just define two GL_TRIANGELS. Be sure to update your set of vertices.

Yes, GL_QUADS is deprecated, but that has nothing to do with LWJGL3.
You can use GL_QUADS if you are using a legacy OpenGL context like version 2.1.