2

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?

JoshWillik
  • 2,624
  • 21
  • 38
  • Maybe try incorporating Ferguzz's changes to `shader.Source()` (https://github.com/Ferguzz/gl/compare/go-gl:master...master) – Intermernet Jan 20 '14 at 03:39
  • 1
    I'm no Go Expert, but I'm not seeing how changing the Source function to accept multiple strings will help me here. I can give it a try tonight though. – JoshWillik Jan 21 '14 at 17:07

1 Answers1

1

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?
ellisbben
  • 6,352
  • 26
  • 43
  • My graphics card supports a 4.4 context, but I was getting 0x502 and 0x501 errors, so at least I have something to look into now. Thank you :) – JoshWillik Jan 24 '14 at 01:44
  • 1
    You're welcome! If you can get a binding to GLU that'll work with the same GL binding, you should definitely try `gluErrorString`-- I think there are other ways to determine what the error really is, but they'll probably be annoying. – ellisbben Jan 24 '14 at 12:33