Sign in to follow this  

Why are my framebuffer textures black?

Recommended Posts

Posted (edited)

Hello. I am struggling with moving to deferred shading with framebuffers. I got forward rendering working perfectly. I am following this tutorial

http://ogldev.atspace.co.uk/www/tutorial35/tutorial35.html

My code is doing the same thing, but the textures (position, texcoord, normal, diffuse) are black, just like nothing gets rendered (but i know the draw calls are executed). The uniforms are correct, textures also, i have extensive error checking in all modules

Pieces of code:

framebuffer.hpp https://pastebin.com/292A92zt

framebuffer.cpp https://pastebin.com/DdJC1xDF

function responsible for rendering https://pastebin.com/t1p6Ft11

deffered shader https://pastebin.com/LV8Fg50u

forward shader https://pastebin.com/nAMvZpfi

 

What may be wrong? Thanks in advance

 

Edit: Being a master of copypasta, for some reason I've ommited " glBindFramebuffer(GL_FRAMEBUFFER, fbo_); " call. Now everything works just fine.... :D

LeJafC5.png

Edited by QQemka

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this