Added note about switching GLSL vesion to 1.2 for Desktop users on RPi 0-3 to avoid confusion about missing effects

master
Trithilon 2 years ago
parent
commit
73d6654a29
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      Working-on-Raspberry-Pi.md

+ 12
- 1
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

Loading…
Cancel
Save