Framebuffer not entirely drawing to the screen
Posted by
D3zmodos on
Dec 25, 2013; 6:03pm
URL: https://forum.jogamp.org/Framebuffer-not-entirely-drawing-to-the-screen-tp4031059.html
Hi,
I'm trying to get started on the use of framebuffers and so I figured I'd try write a simple program which just draws to a new framebuffer and then draws that to the screen/main framebuffer. The issue is that it appears to only draw the colour that I cleared the framebuffer to, not the geometry.
Let me be a little more specific. On my framebuffer I clear to blue, and then draw 2 overlapping squares. I then clear the screenbuffer to red and draw the contents of the framebuffer to screen-sized quad. What I end up with is an entirely blue screen :<
I know that it is in fact drawing *something* from the FBO because the screen is blue, not red. I am also sure that the geometry is indeed getting drawn to the framebuffer because if I print out the pixel contents of that texture, I can see the 2 squares. If I make it draw directly to the screen instead of the FBO, I get the correct image.
I am completely stumped, I've been trying to work at this for ages now but to no avail so if anybody has anything that might help I would be most appreciative.
Code:
http://pastebin.com/B3WwLvKz (Shows the correct image if you comment out lines 82, 92, 97-114)
Shaders:
http://pastebin.com/7ufxtjd9