-1

I'm trying to apply a simple vignette effect to my scene using a framebuffer and offscreen rendering. I was able to get the FBO and the effect working but for some reason my scene is not appearing at all. When the scene loads I can see the objects for a split second then it just goes "blank" (check attached gif). My understanding is that the scene is rendered into the FBO correctly (otherwise it wouldn't be visible at all, not even for a short time), but for some reason it is wiped out by something.

Source files: gist.github.com/morcmarc/31a02dbbd9aad2955f47

http://postimg.org/image/wvhuestr3/

For comparison, this is how it looks rendered directly onto the built-in framebuffer. Just to show the scene seems to be rendering properly.

http://postimg.org/image/jegkle3z9/

genpfault
  • 51,148
  • 11
  • 85
  • 139
morcmarc
  • 163
  • 2
  • 8
  • Try adding some glGetError's to see if gl reports any errors. From my quick read though you don't unbind gl.BindTexture(gl.TEXTURE_2D, this.fboTex) which might cause problems (circular reference?) but it might be something else. – Erik Man Jun 03 '15 at 21:20
  • I tried unbinding it but didn't help. Is gl.Disable(gl.TEXTURE_2D) not enough by the way? Also forgot to mention that I based my post processing on the following http://en.wikibooks.org/wiki/OpenGL_Programming/Post-Processing if you prefer C++ syntax. – morcmarc Jun 03 '15 at 21:34
  • Yes, gl.Disable(gl.TEXTURE_2D) should be enough. I still recommend adding some glGetErrors though, or run it through glintercept https://github.com/dtrebilco/glintercept or similar. – Erik Man Jun 03 '15 at 21:46

1 Answers1

0

Found the problem: forgot to bind the vertex array in my post-processor's render cycle. Checked the code at http://en.wikibooks.org/wiki/OpenGL_Programming/Post-Processing and it's missing there too.

Anyways, it was a good lesson and I feel I've got a better understanding of OpenGL now.

morcmarc
  • 163
  • 2
  • 8