raylib: [examples] Review some examples not working properly on several platforms
Issues on multiple platforms
- REVIEW:
core_3d_camera_free
. Displayed controls do not match and camera behaves strangely.
Issues on PLATFORM_DESKTOP
, macOS (and maybe other platforms/OSs)
- REVIEW:
custom_frame_control
--> Requires raylib built withSUPPORT_CUSTOM_FRAME_CONTROL
. - REVIEW:
models_loading
. It seems to be buggy at selecting the model, needs some review - REVIEW:
skybox_loading
. Doesn’t fill the entire window, only the bottom-left quadrant --> Probably related to HighDPI. - REVIEW:
shader_hot_reloading
,shader_spotlight
. Scaling issue between the mouse and circle positions --> Probably related to HighDPI. - REVIEW:
top_down_lights
. Fully illuminated (no shadows are drawn) until light is moved
Issues on PLATFORM_WEB
- REVIEW:
models_skybox
. WebGL: INVALID_VALUE: disableVertexAttribArray: index out of range _glDisableVertexAttribArray. - REVIEW:
core_custom_frame_control
--> Requires raylib built withSUPPORT_CUSTOM_FRAME_CONTROL
. - REVIEW:
core_loading_thread
--> Threading support depends on the browser and security reasons. - REVIEW:
core_window_flags
--> Most window flags are intended for a window, not a canvas. - REVIEW:
raylib_opengl_interop
--> Example intended for OpenGL desktop, not OpenGL ES. - REVIEW:
rlgl_standalone
-->PLATFORM_DESKTOP
exclusively - REVIEW:
models_mesh_instancing
. Not working properly on web, issues with the shader but ONLY when uploade to GitHub, it works as expected locally.
Issues on PLATFORM_DRM
- REVIEW: Examples with 3D cameras (e.g.:
models_first_person_maze
,core_3d_camera_free
). Camera moving uncontrollably. - REVIEW: Examples with visible cursors (e.g.:
shapes_draw_circle_sector
,shapes_draw_ring
). Cursor not showing. - REVIEW: Examples with type inputs (e.g.:
text_draw_3d
,text_input_box
). Can’t type. - REVIEW:
audio_module_playing
. Crashing the Raspberry Pi after a few seconds. - REVIEW:
core_custom_frame_control
. Flickering and not working. --> Requires raylib built withSUPPORT_CUSTOM_FRAME_CONTROL
. - REVIEW:
core_vr_simulator
. Not rendering. - REVIEW:
models_skybox
. Not rendering. --> Requires enabling HDR loading but maybe not supported by OpenGL ES. - REVIEW:
shaders_raymarching
. Not rendering. --> Shader not adapted for GLSL100. - REVIEW:
shaders_mesh_instancing
. Segmentation fault. --> Not supported by OpenGL ES. - REVIEW:
rlgl_compute_shader
. Not working. --> Not supported by OpenGL ES. - REVIEW:
raylib_opengl_interop
. Not compiling. --> Example intended for OpenGL desktop, not OpenGL ES. - REVIEW:
rlgl_standalone
. Not compiling. -->PLATFORM_DESKTOP
exclusively
Note that some of the issues seem related to platform/OpenGL limitations.
In any case, any help with those examples is really welcome.
About this issue
- Original URL
- State: open
- Created 8 months ago
- Reactions: 2
- Comments: 42 (18 by maintainers)
Commits related to this issue
- REVIEWED: `rlgl_standalone` examples #3487 Example is intended for `PLATFORM_DESKTOP` only and OpenGL 3.3 Core profile. — committed to raysan5/raylib by raysan5 8 months ago
@ubkp @erikyuzwa the
gamejam template
actually belongs to a previous gamejam that required a 32x32 pixels game and it included code to scale that game x4, so I kept the RenderTexture for convenience, also useful to deal with fixed game sizes/screen-ratios that need to be scaled to screen later on.About the log output to file, afair, in Windows CMD,
core_3d_camera_first_person > mylog.txt
should work. But you also haveSetTraceLogCallback(TraceLogCallback callback)
to output the log messages wherever you want.Agreed. I think the major problems were solved or documented. The examples issues left don’t appear to be super critical.
That’s awesome! 👍
Most of the example after adjusting the size, I made it global:
and
from folder
examples
work without problems.This applies to RayGUI as well.
@colesnicov Just note that I’m planning to remove
glad
from raylib dependencies and just load required extensions manually. It would reduce initialization times and memory required… as well as an external dependency.I found this https://gen.glad.sh/, and I’m a deer for it 😄 .
@colesnicov this is a special example to illustrate raylib interoperatibility with OpenGL, it requires including OpenGL libraries.
appreciate the followup and insight there @raysan5 🙇
@erikyuzwa No problem, glad it worked. 😃
I think the problem was that the gamejam template basic structure, for some reason, opts to render to a texture (L79-L82, L124-L130) and them render that texture to screen (L133-L141).
Most of the examples use a far simpler method of just rendering things directly to screen (e.g.: L144-L196), which is probably what I would recommend using while you’re getting used to
raylib
.Regarding the log, on
Linux
it’s usually just a matter of piping the log to a file (e.g.:./core_3d_camera_first_person > LOG
). Windows probably have something similar to that, although I don’t know the syntax.Edit: typo.
@ubkp - that worked! Thanks so much. Not sure why the same code dropped into the rendering in the game template didn’t but I’ll leave that until I work more with textures - thank you SO much and apologies for polluting the OG issue with this.
Here’s the log just in case it helps. I will also go through the source to see if I can pipe the log to a file (for eventual testers).
@erikyuzwa You mentioned you’re using the gamejam template, right? By any chance are you testing using this structure? If so, please test using just this (exactly as is) instead.
@ubkp @Bigfoot71 I reviewed
rlgl_standalone
example, I’m afraid it isPLATFORM_DESKTOP
exclusive and supporting other platforms would require some redesign. I just added a note explaining this. The examples uses GLFW to initialize the platform layer and the OpenGL 3.3 Core profile context. It could work on web with OpenGL ES 2.0 but it would need a redesign, I think it’s out-of-scope for the moment for this example.Actually, all examples in
others
are somewhat special and are not intended to work on all platforms or under “all scenarios”.I think we can continue with the
raylib 5.0
release despite some issues with the examples, they can be reviewed in the future as required.As a side note, today I implemented a tool to update examples open-graph metada, so examples can be shared on multiple social networks (X, Mastodon, LinkedIn, Discord…) with a fancy visual card showing each example details. I will provide more info asap.
@Bigfoot71 I really think it’s platform/drivers-dependant and there is not a good solution to cover most use case. Better leave it as it is. In any case, advance users can change it for their needs depending on their target audience and development process.
@Bigfoot71 Perhaps an
#ifdef
there could solve that for both?@Bigfoot71 Related: #3260, #3261.
@raysan5 I found how to resolve the Z-Fighting issue I mentioned earlier. (on Android)
You need to modify the floating-point precision of the default shader as follows:
However, after some research, it seems that this Z-Fighting issue, which can be resolved by modifying the floating-point precision in the shader, only occurs on certain devices (not high-end or older ones).
@Bigfoot71 I just meant as a reference. Those were just the ones I couldn’t get to work completely here. I think most of those marked with
2
are indeed not meant to run on Android.No, from memory, the few issues I had noticed last time have been fixed, and even
GetMouseDelta()
was implemented as a bonus. I had tried an example in each category on the site, including several from CORE.I will try all of them tomorrow and provide a brief report. Normally, except for some shader examples, I believe they should all be able to run without any problems.
Edit: I had already mentioned it, but unfortunately, I won’t be able to try the example for the gamepad.
Desktop
core_3d_camera_free
Web
models_skybox
SUPPORT_FILEFORMAT_HDR
to be enabled onconfig.h
.Web
core_loading_thread
PLATFORM_WEB
. See the warning on L602-L605, which I think is warranted (check this and this). I don’t think this feature is mature enough yet.Note: There was a recent PR related to this example: #3449
Web
rlgl_standalone
Makefile.Web
but for some reason it just refuses to link to theGLES2/gl2.h
inside emscripten’supstream/emscripten/cache/sysroot/include
.At the moment I’m still unable to make it compile for web.
Web
shaders_mesh_instancing
Testing it on https://www.raylib.com/examples.html I get the errors from the screenshot on Note 1.
My best guess is that the problem could be related to the way the example gets built and/or run on raylib.com.
DRM
models_first_person_maze
core_3d_camera_free
etc
DRM
shapes_draw_circle_sector
shapes_draw_ring
etc
DRM
(L490-L494).Not sure how to handle it in this case. I’m assuming that in this platform the cursor would be rendered by the user on the Drawing step of the application.
References:
core_input_mouse
(L56) and https://github.com/raysan5/raylib/discussions/2952#discussioncomment-7172966.DRM
text_draw_3d
text_input_box
etc
DRM
audio_module_playing
ESC
.DRM
core_vr_simulator
WARNING: FBO: [ID 1] Framebuffer has incomplete attachment
.DRM
models_skybox
IMAGE: Data format not supported
IMAGE: Failed to load image data
.Looks like the Raspberry Pi 3B doesn’t support
HDR
, perhaps the newer ones do.DRM
shaders_raymarching
extension GL_OES_standard_derivates unsupported in fragment shader
.Not sure if this example can run on the Raspberry Pi 3B, perhaps the newer ones can.
DRM
rlgl_standalone
-L../examples/others/external/lib
and-lglfw3
. However, it returns an errorlibglfw3.a: file not recognized: file format not recognized.
. Which leads me to believe that.a
(file) was compiled forx86
and notARM
.IMHO, the easiest (and safest) solution would be the user compiling/providing his own
libglfw3.a
for the Raspberry Pi. Would just be the case of adding that information to the source instructions (L16).Notes
shaders_mesh_instancing
error on raylib.com/examples.html:Edits
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11. updates.
@ubkp @michaelfiber Just opened this issue for further discussion on the examples not working properly that you reported. Actually some of them are not intended to work on the target platform while others have specific concerns.
@Bigfoot71 not sure if you tested all the examples on
PLATFORM_ANDROID
and you also found some issues there…