Raspberry Pi 3 with X Windows and openGL

Hi

I learned about raylib a while a go and it looks like a nice simple library. I think it should be a good match for the Raspberry Pi. I know you have a version for the Pi, but not everyone will be aware that now Raspbian includes a openGL driver that means you can have accelerated graphics in X window. Love2d works perfectly in X on the Pi now and you can get access to the GPU and easily 60fps. Of coarse, love2d does not have 3D support so that is where I would like to try raylib.

I tried to do an install on the Pi using the general linux desktop guide, but it did not go smoothly. Does anyone know if someone has managed to get a desktop X version of raylib compiled and working on Raspbian? A .deb would be great, but I think that is quite a specialist job.

Comments

  • Hi MachineCode, welcome to the forum!

    I'm aware about RPI 3 Mesa driver for OpenGL 2.1 support on desktop X11.

    raylib supports RPI, any version, with no X window, supporting desktop OpenGL 2.1 is limited to RPI 3 (and RPI 2).

    Despite that, raylib supports OpenGL 2.1 desktop backend (set GRAPHICS_API_OPENGL_21) for regular Linux platform (using GLFW3), it should work on the Raspberry Pi... did you try that? what failed on compilation?
  • Hi raysan

    I repeated the process carefully following the wiki guide. No problems setting up the prerequisites.

    pi@raspberrypi:~/raylib/src $ make PLATFORM=PLATFORM_DESKTOP
    raylib library release path is ../release/libs/linux
    ar rcs ../release/libs/linux/libraylib.a rlgl.o core.o audio.o shapes.o models.o textures.o text.o utils.o stb_vorbis.o
    raylib static library generated (libraylib.a)!
    expected OpenAL Soft static library linking


    After this I tried to build the examples:-

    pi@raspberrypi:~/raylib/examples $ make PLATFORM=PLATFORM_DESKTOP
    gcc -o core/core_basic_window core/core_basic_window.c -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -no-pie -D_DEFAULT_SOURCE -I. -I../release/include -I../src -I../src/external -L. -L../release/libs/linux -L../src -lraylib -lglfw3 -lGL -lopenal -lm -lpthread -ldl -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -DPLATFORM_DESKTOP
    ../release/libs/linux/libglfw3.a: error adding symbols: File format not recognized
    collect2: error: ld returned 1 exit status
    Makefile:314: recipe for target 'core/core_basic_window' failed
    make: *** [core/core_basic_window] Error 1

    The RPi 3 is running the latest stretch version of Raspbian and Anholt's opengl driver.
  • ok, one point missing on source compilation, use:
    make PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_21

    About the example error you get, that's because GLFW3 precompiled version provided for linking is for x86 Linux platform, not ARM Raspbian. You should download (apt-get) GLFW3 for Raspbian, same for OpenAL.

    Probably -L../release/libs/linux library path should be modified to point where you download GLFW3 for ARM Raspbian.
  • Hi raysan

    OK got it. The libglfw3 was installed into the home directory and then the compile worked, however it put the libglfw3.a in usr/local/lib. I copied that across into raylib//release/libs/linux and now the build works and I included "make ... GRAPHICS=GRAPHICS_API_OPENGL_21" as you suggested.

    The examples also compile now, but when I try and run one I get this error.

    pi@raspberrypi:~/raylib/examples/core $ ./core_basic_window
    INFO: Initializing raylib (v1.8.0)
    libGL error: MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    WARNING: [GLFW3 Error] Code: 65543 Decription: GLX: Failed to create context: GLXBadFBConfig
    core_basic_window: /home/pi/glfw/src/window.c:467: glfwSetWindowPos: Assertion `window != NULL' failed.
    Aborted

    The MESA-LOADER error happens with other gl apps like glxgears which runs and seems to ignore the warning.

    pi@raspberrypi:~/raylib/release/libs/linux $ glxgears
    libGL error: MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    Running synchronized to the vertical refresh. The framerate should be
    approximately the same as the monitor refresh rate.
    303 frames in 5.0 seconds = 60.455 FPS
    300 frames in 5.0 seconds = 59.992 FPS
    300 frames in 5.0 seconds = 59.803 FPS

  • That's weird. It seems requested OpenGL context can not be created (GLFW3 error displayed).

    Try again with GRAPHICS=GRAPHICS_API_OPENGL_33, just in case, but I think MESA driver only supports up to OpenGL 2.1 on desktop Raspberry Pi.

    By the way, which version of GLFW you installed? Could you check it?
  • "This is version 3.2.1, which adds support for statically linking the Vulkan
    loader and fixes for a number of bugs that together affect all supported
    platforms."

    OK, so I rebuilt raylib with OPENGL_33 and got exactly the same error message.

    So, in the glfw directory - /home/pi/glfw/examples - there are several binaries which were built during the install. boing, gears, particle, simple, splitview, wave all run OK. They all run OK, except heightmap. Maybe it uses some opengl 3.3 feautures that the pi does not support?

    The terminal that spawns them gets the message about the MESA-LOADER, but it looks harmless -

    libGL error: MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information

    It looks from this like the glfw library is installed and capable of running with the anholt opengl driver, so maybe it is a problem with the libglfw3.a file.
  • Hi MachineCode, please could you share the glfw/examples code (and build script) that work fine?

    I'll check how they initialize the window and the context to review it on raylib... :)
  • Hi raysan

    I made a zip of the glfw directory created on my pi machine. This was created by copying the instructions in the wiki, and resulted in this glfw directory in the home directory pi. The build files in glfw are just what was pulled off the git.

    The executables in /examples/ can be run on a rpi by clicking on them and selecting "run in terminal", or by opening a term and running them from there. They all work except heightmap.

    https://www.dropbox.com/s/v8txzdz6xe2sz2n/pi3-glfw.zip?dl=0

  • edited November 3
    Hi MachineCode,

    I've been checking the examples, this is what I found:

    heightmap.c ask for OpenGL 3.2, so, it's expected not to work. Here the example relevant code:
    glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
    glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
    splitview.c, gears.c, wave.c, boing.c, particles.c, all them actually use OpenGL 1.1 (mostly emulated by driver). You can try reproducing it on raylib with:
    GRAPHICS=GRAPHICS_API_OPENGL_11 Let's see if it works... but some functionality of the library won't be available (shaders stuff).

    simple.c uses OpenGL 2.0 (not OpenGL 2.1, the one configured with raylib):
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
    Does it work ok? Does it run in a desktop X11 Window? Maybe driver only support up to OpenGL 2.0?
  • edited November 4
    Success! Nice debugging work. The wiki guide only needs three additions for RPi Xwindows

    1. Use raspi-config to change the pi to opengl driver.
    2. libglfw3.a in usr/local/lib must be copied into raylib//release/libs/linux
    3. build raylib with GRAPHICS=GRAPHICS_API_OPENGL_11

    I rebuilt raylib with GRAPHICS=GRAPHICS_API_OPENGL_11 and then
    deleted all the previous exectutable in /example/..
    recompiled the examples

    Now, most of the examples are working! 59fps and perfectly smooth, running in an X window on the RPi 3.

    There are a couple of examples that have problems, which is no doubt due to the GL1.1 constraint

    models_skybox loads, but just displays a white cube in the middle of the screen.
    pi@raspberrypi:~/raylib/examples/models $ ./models_skybox 
    INFO: Initializing raylib (v1.8.0)
    libGL error: MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    INFO: Display device initialized successfully
    INFO: Display size: 1920 x 1080
    INFO: Render size: 800 x 450
    INFO: Screen size: 800 x 450
    INFO: Viewport offsets: 0, 0
    INFO: GPU: Vendor: Broadcom
    INFO: GPU: Renderer: Gallium 0.4 on VC4 V3D 2.1
    INFO: GPU: Version: 2.1 Mesa 13.0.6
    INFO: GPU: GLSL: 1.20
    INFO: OpenGL default states initialized successfully
    INFO: [TEX ID 1] Texture created successfully (128x128)
    INFO: [TEX ID 1] Default font loaded successfully
    INFO: [resources/pinetree.hdr] Image loaded successfully (2048x1024)
    WARNING: Texture format not supported
    INFO: [TEX ID 2] Texture created successfully (2048x1024)
    INFO: Target time per frame: 16.667 milliseconds
    INFO: Unloaded model data (mesh and material) from RAM and VRAM
    INFO: [TEX ID 1] Unloaded texture data from VRAM (GPU)
    INFO: Window closed successfully
    models_yaw_pitch_roll - fails with a segmentation fault
    pi@raspberrypi:~/raylib/examples/models $ ./models_yaw_pitch_roll 
    INFO: Initializing raylib (v1.8.0)
    libGL error: MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    INFO: Display device initialized successfully
    INFO: Display size: 1920 x 1080
    INFO: Render size: 800 x 450
    INFO: Screen size: 800 x 450
    INFO: Viewport offsets: 0, 0
    INFO: GPU: Vendor: Broadcom
    INFO: GPU: Renderer: Gallium 0.4 on VC4 V3D 2.1
    INFO: GPU: Version: 2.1 Mesa 13.0.6
    INFO: GPU: GLSL: 1.20
    INFO: OpenGL default states initialized successfully
    INFO: [TEX ID 1] Texture created successfully (128x128)
    INFO: [TEX ID 1] Default font loaded successfully
    INFO: [resources/angle_gauge.png] Image loaded successfully (100x100)
    INFO: [TEX ID 2] Texture created successfully (100x100)
    INFO: [resources/background.png] Image loaded successfully (1024x2048)
    INFO: [TEX ID 3] Texture created successfully (1024x2048)
    INFO: [resources/pitch.png] Image loaded successfully (1024x2048)
    INFO: [TEX ID 4] Texture created successfully (1024x2048)
    INFO: [resources/plane.png] Image loaded successfully (512x98)
    INFO: [TEX ID 5] Texture created successfully (512x98)
    INFO: [resources/plane.obj] Model loaded successfully in RAM (CPU)
    INFO: [resources/plane_diffuse.png] Image loaded successfully (512x512)
    INFO: [TEX ID 6] Texture created successfully (512x512)
    Segmentation fault
    The shader examples load, but do not seem to alter the basic texture.

    The physics examples work very well. Interesting that the examples all seem to run at 59fps (which I assume is ~60 rounded down to the integer) and they seem to be using all of one ARM core. The physics examples also run at 59pfs however they saturate 2 cores.

    I was able to run the RPi 3 from my desktop using VNC and the raylib examples work (not quite as smooth, but usable). This means that it is possible to develop and test RPi raylib applications from a desktop or laptop. All you need is a Raspberry Pi 3 and USB Micro charger - no mouse keyboard or screen.

    The opengl driver is supposed to support 2.1, so there must be something causing the raylib 2.1 option to trip.
  • OK, just to double check, I removed raylib directory, got a fresh copy from github, copied in the correct libglfw3.a file and then built raylib with the 2.1 option.

    Most of the examples actually do open a window and run, however -
    text is broken and just displays black rectangles
    yaw_pitch_roll now works correctly, except for text rendering (as above)
    skybox just displays a white screen, no cube or mesh
    shaders still seem to be not working

    rebuilding raylib with 1.1 option reverts to the situation in previous post - almost everything is working apart from shaders and a segmentation fault with the yaw_pitch_roll example.

    Hopefully this makes sense to you - it looks like only minor problems. Raylib is a really nice clean library and it seems to be an excellent match for the Raspberry Pi. Great job!
  • edited November 4
    Hey! It's great that most of the examples work on OpenGL 1.1.

    About OpenGL 1.1 examples:

    models_skybox fails because .hdr texture uses 32bit float data per pixel channel, not supported on OpenGL 1.1.

    models_yaw_pitch_roll should actually work... but I suspect it could be related to textures not being POT (power-of-two), I'll review that.

    Physics run in a second thread, so, the second core used.

    About the 59fps, as you said, that's actually a rounding issue, it's 60fps... need to do something with that...

    About OpenGL 2.1 examples:

    After a quick check, just realized that OpenGL 2.1 texture loading falls back internally to OpenGL 3.3 texture loading mechanism (it was done this way to simplify things). The problem, some specific texture formats (text used one) are not properly loaded for OpenGL 2.1.

    About shaders examples, those shaders are only written for OpenGL 3.3 and OpenGL ES 2.0; they need to be rewritten for OpenGL 2.1...

    Many thanks for the review, with this info I'll try to implement full support for RPI desktop with OpenGL 2.1. Hopefully that way more people will use raylib on RPI.

    :)
  • edited November 4
    Please, try latest develop branch with OpenGL 2.1, just reviewed textures loading, now text should work ok. :wink:
  • OK i grabbed the develop branch and rebuilt for 2.1

    git clone -b develop https://github.com/raysan5/raylib.git raylib (download .zip works as well)

    pi@raspberrypi:~/raylib/src $ make PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_21
    gcc -c rlgl.c -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces -I. -Iexternal -Iexternal/include -DPLATFORM_DESKTOP -DGRAPHICS_API_OPENGL_21
    rlgl.c: In function ‘rlLoadTexture’:
    rlgl.c:1385:69: error: ‘GL_LUMINANCE’ undeclared (first use in this function)
    case UNCOMPRESSED_GRAYSCALE: glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, width, height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, (unsigned char *)data); break;
    ^~~~~~~~~~~~
    rlgl.c:1385:69: note: each undeclared identifier is reported only once for each function it appears in
    rlgl.c:1386:70: error: ‘GL_LUMINANCE_ALPHA’ undeclared (first use in this function)
    case UNCOMPRESSED_GRAY_ALPHA: glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, width, height, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, (unsigned char *)data); break;
    ^~~~~~~~~~~~~~~~~~
    Makefile:386: recipe for target 'rlgl.o' failed
    make: *** [rlgl.o] Error 1


    did a make clean and tried with 1.1 - builds correctly for 1.1 and the examples work the same as for the master branch.
  • edited November 5
    Ok, sorry, corrected. Please, could you try again?

    This is incredible... as per official OpenGL 2.1 documentation, GL_LUMINANCE and GL_LUMINANCE_ALPHA should be defined... actually, they exist in OpenGL 1.1! That's the reason it works...

    Just defined them manually...
  • edited November 5
    OK that has fixed it. Now 2.1 option is building correctly. Text works. yaw_pitch_roll example functions correctly. audio seems to be working properly through the HDMI monitor as well.

    The only examples that do not work are now just the ones that use shaders - as you noted.

    Example - skybox
    INFO: Initializing raylib (v1.8.0)
    libGL error: MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    INFO: Display device initialized successfully
    INFO: Display size: 1920 x 1080
    INFO: Render size: 800 x 450
    INFO: Screen size: 800 x 450
    INFO: Viewport offsets: 0, 0
    INFO: GLAD: OpenGL extensions loaded successfully
    INFO: OpenGL 2.1 profile supported
    INFO: GPU: Vendor: Broadcom
    INFO: GPU: Renderer: Gallium 0.4 on VC4 V3D 2.1
    INFO: GPU: Version: 2.1 Mesa 13.0.6
    INFO: GPU: GLSL: 1.20
    INFO: Number of supported extensions: 0
    INFO: [TEX ID 1] Texture created successfully (1x1)
    INFO: [TEX ID 1] Base white texture loaded successfully
    INFO: [VSHDR ID 1] Vertex shader compiled successfully
    INFO: [FSHDR ID 2] Fragment shader compiled successfully
    INFO: [SHDR ID 3] Shader program loaded successfully
    INFO: [SHDR ID 3] Default shader loaded successfully
    INFO: [CPU] Default buffers initialized successfully (lines, triangles, quads)
    INFO: [VAO ID 1] Default buffers VAO initialized successfully (lines)
    INFO: [VAO ID 2] Default buffers VAO initialized successfully (triangles)
    INFO: [VAO ID 3] Default buffers VAO initialized successfully (quads)
    INFO: OpenGL default states initialized successfully
    INFO: [TEX ID 2] Texture created successfully (128x128)
    INFO: [TEX ID 2] Default font loaded successfully
    INFO: [VAO ID 4] Mesh uploaded successfully to VRAM (GPU)
    WARNING: [VSHDR ID 4] Failed to compile vertex shader...
    INFO: 0:9(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES

    WARNING: [FSHDR ID 5] Failed to compile fragment shader...
    INFO: 0:9(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES

    WARNING: [SHDR ID 6] Failed to link shader program...
    INFO: error: linking with uncompiled shadererror: linking with uncompiled shader
    WARNING: Custom shader could not be loaded
    WARNING: [SHDR ID 3] Shader uniform [environmentMap] COULD NOT BE FOUND
    WARNING: [VSHDR ID 7] Failed to compile vertex shader...
    INFO: 0:9(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES

    WARNING: [FSHDR ID 8] Failed to compile fragment shader...
    INFO: 0:9(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES

    WARNING: [SHDR ID 9] Failed to link shader program...
    INFO: error: linking with uncompiled shadererror: linking with uncompiled shader
    WARNING: Custom shader could not be loaded
    WARNING: [SHDR ID 3] Shader uniform [equirectangularMap] COULD NOT BE FOUND
    INFO: [resources/pinetree.hdr] Image loaded successfully (2048x1024)
    WARNING: Texture format not supported
    INFO: [TEX ID 3] Texture created successfully (2048x1024)
    INFO: [SHDR ID 3] Unloaded shader program data
    INFO: Target time per frame: 16.667 milliseconds
  • Hi MachineCode!

    Just updated textures on models_yaw_pitch_roll example, please, could you try if it works with OpenGL 1.1 in the RPI?

    Also uploaded updated shaders for GLSL 120, please, could you try shaders_ examples with OpenGL 2.1 on desktop? You need to update loading path to resources/shaders/glsl120/...

    Examples that won't work: models_skybox and models_material_pbr. They require some features not available on RPI.
  • OK, so the yaw_pitch_roll with 1.1 and updated POT textures is negative
     pi@raspberrypi:~/raylib/examples/models $ ./models_yaw_pitch_roll 
    INFO: Initializing raylib (v1.8.0)
    libGL error: MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    INFO: Display device initialized successfully
    INFO: Display size: 1920 x 1080
    INFO: Render size: 800 x 450
    INFO: Screen size: 800 x 450
    INFO: Viewport offsets: 0, 0
    INFO: GPU: Vendor: Broadcom
    INFO: GPU: Renderer: Gallium 0.4 on VC4 V3D 2.1
    INFO: GPU: Version: 2.1 Mesa 13.0.6
    INFO: GPU: GLSL: 1.20
    INFO: OpenGL default states initialized successfully
    INFO: [TEX ID 1] Texture created successfully (128x128)
    INFO: [TEX ID 1] Default font loaded successfully
    INFO: [resources/angle_gauge.png] Image loaded successfully (128x128)
    INFO: [TEX ID 2] Texture created successfully (128x128)
    INFO: [resources/background.png] Image loaded successfully (1024x2048)
    INFO: [TEX ID 3] Texture created successfully (1024x2048)
    INFO: [resources/pitch.png] Image loaded successfully (1024x2048)
    INFO: [TEX ID 4] Texture created successfully (1024x2048)
    INFO: [resources/plane.png] Image loaded successfully (512x128)
    INFO: [TEX ID 5] Texture created successfully (512x128)
    INFO: [resources/plane.obj] Model loaded successfully in RAM (CPU)
    INFO: [resources/plane_diffuse.png] Image loaded successfully (512x512)
    INFO: [TEX ID 6] Texture created successfully (512x512)
    Segmentation fault
    I rebuilt with 2.1 and edited the shader .c files to redirect to the glsl120 directory. The shaders are not compiling it would seem
     INFO: Initializing raylib (v1.8.0)
    INFO: Trying to enable MSAA x4
    libGL error: MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    MESA-LOADER: failed to retrieve device information
    INFO: Display device initialized successfully
    INFO: Display size: 1920 x 1080
    INFO: Render size: 800 x 450
    INFO: Screen size: 800 x 450
    INFO: Viewport offsets: 0, 0
    INFO: GLAD: OpenGL extensions loaded successfully
    INFO: OpenGL 2.1 profile supported
    INFO: GPU: Vendor: Broadcom
    INFO: GPU: Renderer: Gallium 0.4 on VC4 V3D 2.1
    INFO: GPU: Version: 2.1 Mesa 13.0.6
    INFO: GPU: GLSL: 1.20
    INFO: Number of supported extensions: 0
    INFO: [TEX ID 1] Texture created successfully (1x1)
    INFO: [TEX ID 1] Base white texture loaded successfully
    INFO: [VSHDR ID 1] Vertex shader compiled successfully
    INFO: [FSHDR ID 2] Fragment shader compiled successfully
    INFO: [SHDR ID 3] Shader program loaded successfully
    INFO: [SHDR ID 3] Default shader loaded successfully
    INFO: [CPU] Default buffers initialized successfully (lines, triangles, quads)
    INFO: [VAO ID 1] Default buffers VAO initialized successfully (lines)
    INFO: [VAO ID 2] Default buffers VAO initialized successfully (triangles)
    INFO: [VAO ID 3] Default buffers VAO initialized successfully (quads)
    INFO: OpenGL default states initialized successfully
    INFO: [TEX ID 2] Texture created successfully (128x128)
    INFO: [TEX ID 2] Default font loaded successfully
    INFO: [resources/model/dwarf.obj] Model loaded successfully in RAM (CPU)
    INFO: [VAO ID 4] Mesh uploaded successfully to VRAM (GPU)
    INFO: [resources/model/dwarf_diffuse.png] Image loaded successfully (2048x2048)
    INFO: [TEX ID 3] Texture created successfully (2048x2048)
    INFO: [VSHDR ID 4] Vertex shader compiled successfully
    WARNING: [FSHDR ID 5] Failed to compile fragment shader...
    INFO: 0:3(1): error: illegal use of reserved word `precision'
    0:3(1): error: syntax error, unexpected ERROR_TOK

    WARNING: [SHDR ID 6] Failed to link shader program...
    INFO: error: linking with uncompiled shader
    WARNING: Custom shader could not be loaded
    INFO: [VSHDR ID 7] Vertex shader compiled successfully
    WARNING: [FSHDR ID 8] Failed to compile fragment shader...
    INFO: 0:3(1): error: illegal use of reserved word `precision'
    0:3(1): error: syntax error, unexpected ERROR_TOK

    WARNING: [SHDR ID 9] Failed to link shader program...
    INFO: error: linking with uncompiled shader
    WARNING: Custom shader could not be loaded
    INFO: [VSHDR ID 10] Vertex shader compiled successfully
    WARNING: [FSHDR ID 11] Failed to compile fragment shader...
    INFO: 0:3(1): error: illegal use of reserved word `precision'
    0:3(1): error: syntax error, unexpected ERROR_TOK

    .
    .
    .

    WARNING: [SHDR ID 39] Failed to link shader program...
    INFO: error: linking with uncompiled shader
    WARNING: Custom shader could not be loaded
    INFO: [FBO ID 1] Framebuffer object created successfully
    INFO: Target time per frame: 16.667 milliseconds
    ====

  • edited November 6
    ok, just reviewed it, precision directive seems not to be supported on GLSL 120... depending on the driver some directives could be just ignored or fail with error or just say nothing and fail silently... it's a mess dealing with multiple GLSL versions... :(

    About models_yaw_pitch_roll, probably issue is related to framebuffer creation code... it works ok on OpenGL ES 2.0 but it fails for OpenGL 2.1... just reviewed some code...

    EDIT: I've been all morning correcting a crazy issue with models drawing that just appeared after updating RPI to latest version...
  • It is a pity about the Skybox issue. I installed OpenArena (based on gl quake) from the repositories, and it also fails with shader errors which look like they are skybox related. There is not much bout this in the VC4 blogs, except last year he posted that cubemap support was added.

    Skybox has been pretty standard for over 10 years, so that would mean that the opengl driver for the RPi will trip up on most 3D games (not that there are that many open source). My understanding is that the VC4 is limited to 2.1. The bright side is that Anholt is working on drivers for the next generation VC5 which can handle a full opengl implimentation. The expectation is that Raspberry Pi 4 (when they release it) will use VC5 and be a viable alternative to the x86 desktop.
  • Hi MachineCode, actually, I think skybox could work on OpenGL 2.1 but the example and some raylib internals should be specifically crafted for that pourpouse... it would take some time...

    VC4 is limited to OpenGL ES 2.0 + some extensions, all together could be mapped to some extend with OpenGL 2.1 (I will also say lot of OpenGL 3.1). VC5 will probably support OpenGL ES 3.1, that maps (kind of) to OpenGL 4.3.
Sign In or Register to comment.