Framebuffer errors when using EGL with render pipeline

I just use the basic sample code to test Render Pipeline + panda3d 1.10.9 in Ubuntu 18.04. It works fine with X11. But after switching to EGL for headless rendering, I got a bunch of frame buffer errors. :display:gsg:glgsg(error): GL_INVALID_FRAMEBUFFER_OPERATION error generated. Operation is not valid because a bound framebuffer is not framebuffer complete.
Here is my testing code:

import sys
from direct.showbase.ShowBase import ShowBase

from panda3d.core import loadPrcFileData

class Application(ShowBase):

    def __init__(self):
        loadPrcFileData("", "window-type offscreen")
        loadPrcFileData("", "aux-display p3headlessgl")
        loadPrcFileData('', 'load-display pandagl')
        loadPrcFileData('', 'gl-coordinate-system default')
        loadPrcFileData('', 'notify-level-gobj info')

        sys.path.insert(0, "/usr/share/rgbtracking/sp-renderpipeline/")

        # Import the main render pipeline class
        from rpcore import RenderPipeline

        # Construct and create the pipeline
        self.render_pipeline = RenderPipeline()

        # Save some offline frames.
        base.screenshot('test1.jpg', defaultFilename=False)
        base.screenshot('test2.jpg', defaultFilename=False)
        base.screenshot('test3.jpg', defaultFilename=False)
        base.screenshot('test.jpg', defaultFilename=False)


Based on the log, it seems like the Sky Occlusion and Environment Probes plugins do not work well under EGL.

Has anyone ever tried to use render pipeline with EGL/headless rendering?

Hi, welcome to the forum! :slight_smile:

A bunch of issues were fixed since 1.10.9 related to framebuffers in EGL, can you update to the latest version, 1.10.11?

1 Like

Thanks for the quick response! I’ve upgraded to 1.10.11 via pip install panda3d==1.10.11, but the issues are the same. I also notice that the shadow effects with render pipeline lighting are broken under EGL

I have resolved this problem. The frame buffer errors and broken lightings are caused by the size mismatch between the depth and stencil buffers. Stencil buffer uses 32bits while depth buffer is set to use 16bits in lighting shadow stage, Sky Occlusion and Environment Probes. Changing the depth buffer to 32bit via the add_depth_attachment function will fix the problem

1 Like