Write and Test filter()
main.cpp
filter()
void filter()
{
// unbind the framebuffer to test it in your window
// glBindFramebuffer(GL_FRAMEBUFFER,0);
glBindFramebuffer(GL_FRAMEBUFFER, blurFBO);
// set the viewport size to bloom buffer width and height
glViewport(0, 0, bloomBufWidth, bloomBufHeight);
// depth test is not needed for image processing
glDisable(GL_DEPTH_TEST);
// clear the background
glClearColor(0, 0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT);
// draw the full screen square
square->setShaderId(bloomfilterShader);
square->draw(glm::mat4(1.0f), glm::mat4(1.0f), glm::mat4(1.0f));
}init shaders in the shader section in main()
call filter() in the event loop
Test filter()

Last updated