FBO rendering problems in Cinder 0.9.1 on Raspberry Pi 2


#1

Hi,

I’m having problems where the FBO is not rendered in my app on Raspberry Pi 2.
Trying the samples/_opengl/FboBasic/ sample, I see a grey background with a white square, rather than the rotating cubes that should appear.
This sample works correctly on the pi with an older version of Cinder (#1bc47a0) from April 2016.

Here is what I have tried:
I have compiled cinder and the FboBasic sample by following the instructions here, including the -DCINDER_TARGET_GL=es2-rpi flag:
https://www.libcinder.org/docs/guides/linux-notes/rpi2.html

I have also tried the experimental OpenGL desktop driver using the raspi-config tool, with an increased memory-split of 128mb and 512mb. After changing these settings I made sure to reboot and recompile both Cinder and the FboBasic sample app.
This resulted in a fatal error on startup:

graphics_get_display_size failed, returned: -1

This error was observed with both Cinder 0.9.1 and the older working (#1bc47a0) version.
/opt/vc/src/hello_pi/hello_triangle also failed to start with the error:

* failed to add service - already in use?

From this I determined that experimental OpenGL was not the way to go.
I referred to this thread discussing this error:
https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=12581

Running with Cinder 0.9.1 I get:

gl_es_load entered...
Extension: GL_OES_compressed_ETC1_RGB8_texture
Extension: GL_OES_compressed_paletted_texture
Extension: GL_OES_texture_npot
Extension: GL_OES_depth24
Extension: GL_OES_vertex_half_float
Extension: GL_OES_EGL_image
Extension: GL_OES_EGL_image_external
Extension: GL_EXT_discard_framebuffer
Extension: GL_OES_rgb8_rgba8
Extension: GL_OES_depth32
Extension: GL_OES_mapbuffer
Extension: GL_EXT_texture_format_BGRA8888
Extension: GL_APPLE_rgb_422
Extension: GL_EXT_debug_marker
gl_es_2_0_ext_load: SUCCESSFUL! | 9 procs loaded
gl_es_load: SUCCESSFUL
|warning| static void cinder::gl::TextureBase::getInternalFormatInfo(GLint, GLenum *, GLenum *, bool *, bool *, bool *)[435] Unknown internalFormat:GL_DEPTH_COMPONENT24
|warning| static void cinder::gl::TextureBase::getInternalFormatInfo(GLint, GLenum *, GLenum *, bool *, bool *, bool *)[435] Unknown internalFormat:GL_DEPTH_COMPONENT24
Mouse and keyboard input successfully initialized

The difference compared to the output under the older version of cinder is in these two warnings:

|warning| static void cinder::gl::TextureBase::getInternalFormatInfo(GLint, GLenum *, GLenum *, bool *, bool *, bool *)[435] Unknown internalFormat:GL_DEPTH_COMPONENT24
|warning| static void cinder::gl::TextureBase::getInternalFormatInfo(GLint, GLenum *, GLenum *, bool *, bool *, bool *)[435] Unknown internalFormat:GL_DEPTH_COMPONENT24

From looking at the cinder code, it seems to be related to the CINDER_GL_ES_2 symbol.
I tried compiling with CINDER_GL_ES_2=1 but there was no change.

I made sure to run

sudo apt-get update
sudo apt-get dist-upgrade
sudo rpi-update

I’m using a Raspberry Pi 2, running Raspbian GNU/Linux 8 (jessie) also known as Pixel.
Running uname -a gives:

Linux raspberrypi 4.9.36-v7+ #1015 SMP Thu Jul 6 16:14:20 BST 2017 armv7l GNU/Linux

Commands are run from a terminal in the desktop environment (after running startx).

Any help would be much appreciated.
Callum.


#2

Hey,

try this PR https://github.com/cinder/Cinder/pull/1871. Should fix the issue for you.

Cheers,
Petros


#3

That fixes it, all resolved thanks!