From 73d6654a29f27596fd84b2d648b89d3cd5438c8b Mon Sep 17 00:00:00 2001 From: Trithilon Date: Sat, 20 Aug 2022 17:09:33 +0530 Subject: [PATCH] Added note about switching GLSL vesion to 1.2 for Desktop users on RPi 0-3 to avoid confusion about missing effects --- Working-on-Raspberry-Pi.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Working-on-Raspberry-Pi.md b/Working-on-Raspberry-Pi.md index f3b34dd..47035e4 100644 --- a/Working-on-Raspberry-Pi.md +++ b/Working-on-Raspberry-Pi.md @@ -41,8 +41,19 @@ Just navigate to `raylib\src\` directory and run one of the following options de ``` make PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_21 ``` +Raylib examples use GLSL 3.3 shaders. Older Raspberry Pi's 0-3 only support upto GLSL 1.2. If you are on Raspberry Pi OS desktop on something lower than RPi4 you will see that shaders will default to a base shader and examples may not look as intended. To fix this, we need to tell Raylib to load GLSL 1.2 versions of the shader in the .c file of the example which will look something like this: -NOTE: To use raylib on the Raspberry Pi desktop, you need to had previously installed all desktop window-dev system libraries, if you just downloaded [Raspberry Pi OS Desktop](https://www.raspberrypi.org/software/operating-systems/), maybe it comes with required libraries installed but if it complains on compilation, just make sure to install the following libraries: +``` +#if defined(PLATFORM_DESKTOP) + #define GLSL_VERSION 120 // Change this back to 330 if compiling for a platform that supports GLSL3.3 +#else // PLATFORM_RPI, PLATFORM_ANDROID, PLATFORM_WEB + #define GLSL_VERSION 100 +#endif +``` +Also, ensure the correct versions of the shaders are available in the raylib/examples/resources/shaders/glsl120 folder. +Troubleshooting is easier while running your example from a terminal as raylib will log the errors over there. + +NOTE on compilation errors: To use raylib on the Raspberry Pi desktop, you need to had previously installed all desktop window-dev system libraries, if you just downloaded [Raspberry Pi OS Desktop](https://www.raspberrypi.org/software/operating-systems/), maybe it comes with required libraries installed but if it complains on compilation, just make sure to install the following libraries: ``` sudo apt-get install --no-install-recommends raspberrypi-ui-mods lxterminal gvfs sudo apt-get install libx11-dev libxcursor-dev libxinerama-dev libxrandr-dev libxi-dev libasound2-dev mesa-common-dev libgl1-mesa-dev