OpenGL Tutorial 18 - Framebuffer & Post-processing

preview_player
Показать описание
In this tutorial I'll show you how to create a custom framebuffer in OpenGL on which you can apply different post-processing effects.

*Source Code*

*OpenGL Documentation*

*Discord Server*

*Patreon*

*Timestamps*
0:00 Introduction
0:10 What is a Framebuffer?
0:24 Uses
0:46 FBO
0:59 Color Texture
1:21 Texture vs Renderbuffer
1:44 Renderbuffer
2:04 Errors
2:28 Framebuffer Rectangle
2:38 Base Shaders
2:48 Drawing the Framebuffer
3:24 Errors Tips
3:50 Simple Effects
4:05 Kernel Effects
5:36 Ending

*References*

#opengl #opengltutorial #computergraphics #cpp #visualstudio
Рекомендации по теме
Комментарии
Автор

this is really handy. anytime i need to revise or learn something related to opengl, victors video pops up

kurciqs
Автор

I'm still on the first videos but I wanted to say thank you. There's almost nothing about OpenGL in my language, it's difficult to learn in another one but you speak clearly and slowly so I can understand you. Keep it up!

starklosch
Автор

Short, simple and informative. I love it!

fudgeracoon
Автор

Yes this is great frame buffers are also used to render your scene to a imgui window!

smokinglife
Автор

I love your tutorials man! They have really helped me with my projects and they have taught me a lot. Keep it up :)

bpm.coding
Автор

damn, the way you explained kernels made me understand more clearly. I've been working on object outlining techniques in the past week and I'm trying different techniques.

sebp
Автор

Hey Victor, thanks so much for this informative video. I was wondering if rendering to a framebuffer maintains anti-aliasing? If not, is there a more straightforward way to enable anti-aliasing than having to render to a multi-sampled texture?

paradigmshift
Автор

I appreciate the tutorial. I wish you would use DSA functions though.

undeadpresident
Автор

Hi, hope you still have time to answer questions!

I was just wondering when we create our quadVAO and quadFBOs we are doing EnableVertexAttribArray(0) and EnableVertexAttribArray(1), which means that in the vertex buffer for our framebuffer shaders the position of the first triangle is stored in position 0 and then the position of the second triangle is stored in position 1 of the vertex buffer (is that a correct interpretation?)

I was just a bit confused since in the frambuffer.vert we then pick the positions from layout location 0 and then the texture coordinates from layout location 1, isn't that the positioning of the two different triangles covering the screen and not the texture coordinate? I am having some trouble with my code so trying to debug it and I thought this could have to do with it! :)

Felicia-wciz
Автор

Hey Victor when I load the normal map with post processing FBO on, it just draws the normal texture on screen instead of applying it to the model, when I disable the post FBO it works just fine. The code is identical to yours. Do you know why is that happening?

diahaidificbs
Автор

Once again cool video. I guess a shadow mapping video is coming soon, correct?

jedder
Автор

hello love your tutorials could you show us how to move the model?

LynJuice
Автор

Really wish you had this same tutorial using DSA. I'm trying to write a DSA openGL application right now and it's like pulling teeth - every tutorial, even ones made in the last year or two are using pre-DSA patterns. DSA patterns are so much closer to how all the other mainstream graphics APIs work, I'd much rather be using DSA :/

bpelectric
Автор

it would be nice of you if you could make a video of Point Shadows too. Thank you very much

hamedkabirclashroyale
Автор

I'm jumping into this series on this video as I was hoping to add post-processing effects to my game. Butafter going through it, I'm having an issue with the GL_DEPTH_TEST. For some reason, reactivating it in my render loop does not work properly. Once I deactivate, it does not reactivate. Anyone got any suggestions on what this might be? Either way, this seems like a great tutorial series, and I'm looking forward to diving in further!

ziggycross
Автор

Hello Victor! Hope you are well. I want to render my framebuffer onto an imgui window but I can't get it to work. I'm trying to pass texture reference to the ImTexId but I get a black image... What could be wrong? Also are you planning on an imgui tutorial in future?

mackerel
Автор

my object's texture is being rendered to the screen as an image instead of the scene, any tips?

phule
Автор

Hi, love your tutorial
I saw that you had VAO.h and VBO.h, is it possible to call functions from them and create more like RBO.h and FBO.h?

keithle_
Автор

-When resizing the window, should I recreate the framebuffer?-
-Since I've noticed that if I change the window size, it looks weird.-

For anyone else who doesn't want a static size, you can do for example

GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgb, ClientSize.X, ClientSize.Y, 0,
PixelFormat.Rgb, PixelType.UnsignedByte, IntPtr.Zero);

GL.BindRenderbuffer(RenderbufferTarget.Renderbuffer, _postprocessRenderbuffer);
GL.RenderbufferStorage(RenderbufferTarget.Renderbuffer, RenderbufferStorage.Depth24Stencil8, ClientSize.X,
ClientSize.Y);

If you encounter Framebuffer Incomplete when in fullscreen and alt + tabbing, skip rendering all together since that could mean that the screen size is 0.

PatrickFrom
Автор

Not sure if you still reply on this, I'm having an issue where one of the base color images from a model is shown as a image on the screen and I can still apply the effects to it so it's working, but why is it showing a flat image now? I have also copied and paste most of the code.

qiveal