[Interest] OpenGL weirdness

Sean Harmer sean.harmer at kdab.com
Thu Aug 14 17:43:59 CEST 2014

On Friday 25 Jul 2014 06:20:35 Yves Bailly wrote:
> On 24/07/2014 20:33, Till Oliver Knoll wrote:
> > Am 24.07.2014 um 14:13 schrieb Yves Bailly <Yves.Bailly at verosoftware.com>:
> [...]
> >>    fmt.setVersion(2, 1);
> >> 
> >> ...getGetString(GL_VERSION) gives "4.4.0" (unexpected), and no triangle
> >> displayed.> 
> > As already mentioned in a previous reply: maybe a bit "unexpected", but
> > totally> 
>  > fine, because you get a "Compatibility" profile.
>  > 
> >> With simply requesting the profile, without giving a version:
> > Doesn't make sense really: profiles are only introduced on OpenGL 3.2 and
> > above :)> 
> >> Any idea about what's going on?
> > 
> > I strongly assume that you're not using any "fixed pipeline" functions
> > such
> > 
>  > as glVertex etc. ;) so my best bet would be your shader code: did you
>  > copy/paste from some older OpenGL (ES) 2 shaders?
> Thanks all for your answers, finally I found where the "problem" was. In
> short, here's what happened.
> This was a piece of code which used to work fine with Qt 5.2.1, a few months
> ago. Indeed no fixed pipeline, good "#version 330" shaders, and so on.
> Yesterday I just rebuild it but using Qt 5.3.1, to see it was no more
> working. Why?
> In the meantime, two things had change: the Qt version, *and* I got a new
> workstation, with a new GPU, a new OS, a new driver..... And this is where
> the problem lies. In my code, I was *not* using any VAO. It seems the "old"
> driver was always giving me a "compatibility" profile - hence no need for
> VAOs.
> But the new drivers gives me a real "core" profile, in which VAOs are
> mandatory. No VAO, no display... :-) Just adding the needed VAOs made the
> things work again.

Ah just one of a gazillion ways you can see nothing with OpenGL. My recent 
hilarious cause of not seeing anything was to render a quad. Shaders were 
fine, all buffers and VAOs set correctly, all uniforms looked fine... almost. 
It turned out my modelview matrix was rendering exactly edge on resulting in 
zero pixels being rasterised. Isn't graphics fun ;)


Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions

More information about the Interest mailing list