openglgotesselation

Tesselation in Go-GL


I'm trying to tesselate a simple triangle using the Golang OpenGL bindings

The library doesn't claim support for the tesselation shaders, but I looked through the source code, and adding the correct bindings didn't seem terribly tricky. So I branched it and tried adding the correct constants in gl_defs.go.

The bindings still compile just fine and so does my program, it's when I actually try to use the new bindings that things go strange. The program goes from displaying a nicely circling triangle to a black screen whenever I actually try to include the tesselation shaders.

I'm following along with the OpenGL Superbible (6th edition) and using their shaders for this project, so I don't image I'm using broken shaders (they don't spit out an error log, anyway). But in case the shaders themselves could be at fault, they can be found in the setupProgram() function here.

I'm pretty sure my graphics card supports tesselation because printing the openGL version returns 4.4.0 NVIDIA 331.38 .

So my questions:

Is there any reason adding go bindings for tesselation wouldn't work? The bindings seem quite straightforward. Am I adding the new bindings incorrectly?

If it should work, why is it not working for me? What am I doing wrong here?


Solution

  • Steps that might be worth taking:

    1. Your driver and video card may support tessellation shaders, but the GL context that your binding is returning for you might be for an earlier version of OpenGL. Try glGetString​(GL_VERSION​) and see what you get.
    2. Are you calling glGetError basically everywhere and actually checking its values? Does this binding provide error return values? If so, are you checking those?