FBO hack using OpenGL Wrapper with deferred rendering shader

This example shows how to render a frame buffer with the objects in the scene.
I also added very basic and simple deferred rendering shader.
It also shows how to use a render buffer for the depth and stencil.

The example is not finished, so it is very possible that is cause errors or crashes.


To get the example work properly, it must be started in the “Standalone Player”, otherwise the FBO rendering area is offsetted by the Blender frame.
This example only contains the blend file, therefore the PyOpenGL wrapper need to be downloaded and copied into the same directory as the blend file.
It does not work if a lamp has shadows enabled, because for the shadows it self a FBO is used.

PyOpenGL: https://www.dropbox.com/sh/81ggm1ynv1l3w2m/AAADaCPPPfa-hAWNOc_Dz8tZa?dl=0
File only: https://www.dropbox.com/s/6ypiippgtb3j7kg/Framebuffer.blend?dl=0

New version 1.1 (file only): https://www.dropbox.com/s/w8nfhsai01ttz25/Framebuffer1.1.blend?dl=0

Awesome. Congrats. Now with this, we could make ping pong as asked by Maujoe on the forum, if I’m not mistaken? And soft particles!

Yes, thats right. I already have experimented a little bit with the example, I hope that I will have more time for this soon. :slight_smile:

I have made a little testfile for ping pong rendering. At the moment it makes nothing special, it only changes the color of a plane in small steps from black to white.
FBO_pingpong.blend (93.4 KB)
I will take a look to particle rendering with this.:slight_smile:

Updated version 1.1 (file only).

hi,
HG1 I’ve seen you’ve made this report:


And you speek about black screen…
Did you solve the issue, ave you a new file to provide, I’m really inetrested by the FBO possibility.
Thanks

@kgeogeo This test file was only to make a quick test if are the new API calls are working.
I don’t have fixed the black screen problem in my example file. But I found out why everything is black. I t is basically that black viewport will render over the render image which I created with the OpenGL calls. With some changes it should be possible to get it work in the UPBGE. But actually I am not interested to do this.

now that we have a branch of UPBGE - ( ge_render_attachment) - with multiple render targets,

we can accelerate this no?