Open Gutza opened 1 year ago
I experimented with a few older versions of glslViewer; went back as far as v2.2.1, and the behavior is the same. I think the problem is caused by an external library or configuration directive, but I can't even figure out where to begin investigating this further.
A (probably unrelated) issue I noticed while building glslViewer repeatedly: executing cmake
the first time always fails, and the second time it works with no change whatsoever on my part:
$ rm -rf build && mkdir build && cd build
$ # First attempt
$ cmake -DNO_X11=TRUE ..
-- The CXX compiler identification is GNU 10.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find BROADCOM (missing: BCM_EGL BCM_GLESv2)
-- PLATFORM RASPBERRYPI
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Could NOT find FFMPEG (missing: FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Checking for modules 'libavdevice;libavfilter;libavformat;libavcodec;libswresample;libswscale;libavutil'
-- No package 'libavdevice' found
-- No package 'libavfilter' found
-- No package 'libavformat' found
-- No package 'libavcodec' found
-- No package 'libswresample' found
-- No package 'libswscale' found
-- No package 'libavutil' found
-- USING DRM and GBM DRIVERS
-- Found DRM: /usr/include/libdrm
-- Found GBM: /usr/lib/aarch64-linux-gnu/libgbm.so (found version "20.3.5")
-- Performing Test GBM_HAS_BO_MAP
CMake Error at /usr/share/cmake-3.18/Modules/CheckCSourceCompiles.cmake:109 (try_compile):
Unknown extension ".c" for file
/home/bogdan/glslViewer/build/CMakeFiles/CMakeTmp/src.c
try_compile() works only for enabled languages. Currently these are:
CXX
See project() command to enable other languages.
Call Stack (most recent call first):
deps/vera/cmake/FindGBM.cmake:34 (check_c_source_compiles)
deps/vera/src/CMakeLists.txt:177 (find_package)
-- Performing Test GBM_HAS_BO_MAP - Failed
-- Performing Test GBM_HAS_MODIFIERS
CMake Error at /usr/share/cmake-3.18/Modules/CheckCSourceCompiles.cmake:109 (try_compile):
Unknown extension ".c" for file
/home/bogdan/glslViewer/build/CMakeFiles/CMakeTmp/src.c
try_compile() works only for enabled languages. Currently these are:
CXX
See project() command to enable other languages.
Call Stack (most recent call first):
deps/vera/cmake/FindGBM.cmake:42 (check_c_source_compiles)
deps/vera/src/CMakeLists.txt:177 (find_package)
-- Performing Test GBM_HAS_MODIFIERS - Failed
-- Found EGL: /usr/lib/aarch64-linux-gnu/libEGL.so (found version "1.5")
-- KHR/usr/include
-- Found GLESv2: /usr/lib/aarch64-linux-gnu/libGLESv2.so
-- EGL_INCLUDE_DIRS: /usr/include
-- EGL_LIBRARIES: /usr/lib/aarch64-linux-gnu/libEGL.so
-- GLESv2_INCLUDE_DIRS: /usr/include;/usr/include
-- GLESv2_LIBRARIES: /usr/lib/aarch64-linux-gnu/libGLESv2.so
-- If you are using the static library build, please keep in mind (and inform yourself of the implications) that liblo is licensed with LGPL v2.1+.
-- The C compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for poll
-- Looking for poll - found
-- Looking for select
-- Looking for select - found
-- Looking for getifaddrs
-- Looking for getifaddrs - found
-- Looking for inet_pton
-- Looking for inet_pton - found
-- Check how to print long long int
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
-- package_details.cmake: your architecture is arm64
-- Configuring incomplete, errors occurred!
See also "/home/bogdan/glslViewer/build/CMakeFiles/CMakeOutput.log".
See also "/home/bogdan/glslViewer/build/CMakeFiles/CMakeError.log".
$ # Second attempt
$ cmake -DNO_X11=TRUE ..
-- Could NOT find BROADCOM (missing: BCM_EGL BCM_GLESv2)
-- PLATFORM RASPBERRYPI
-- Could NOT find FFMPEG (missing: FFMPEG_LIBRARIES FFMPEG_LIBRARY_DIRS FFMPEG_INCLUDE_DIRS)
-- Checking for modules 'libavdevice;libavfilter;libavformat;libavcodec;libswresample;libswscale;libavutil'
-- No package 'libavdevice' found
-- No package 'libavfilter' found
-- No package 'libavformat' found
-- No package 'libavcodec' found
-- No package 'libswresample' found
-- No package 'libswscale' found
-- No package 'libavutil' found
-- USING DRM and GBM DRIVERS
-- KHR/usr/include
-- EGL_INCLUDE_DIRS: /usr/include
-- EGL_LIBRARIES: /usr/lib/aarch64-linux-gnu/libEGL.so
-- GLESv2_INCLUDE_DIRS: /usr/include;/usr/include
-- GLESv2_LIBRARIES: /usr/lib/aarch64-linux-gnu/libGLESv2.so
-- If you are using the static library build, please keep in mind (and inform yourself of the implications) that liblo is licensed with LGPL v2.1+.
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
-- package_details.cmake: your architecture is arm64
-- Configuring done
-- Generating done
-- Build files have been written to: /home/bogdan/glslViewer/build
I also noticed something else while playing around with the LYGIA Shader examples; I think this is related to the original issue:
The PBR Glass (material) example works (and displays correctly, except that the angle is wrong, for some reason):
$ glslViewer assets/dragon.obj lighting_pbrGlass.frag -e camera_position,1.43923,-0.891203,-1.98093
// > exit
The Shadow (material) example issues a single FBO not complete error, and displays a partially rendered image (very flat-looking, greyed out):
glslViewer assets/dragon.obj lighting_shadow.frag -e camera_position,1.43923,-0.891203,-1.98093
FBO: not complete 36054
// > exit
The Sample DoF example issues three FBO not complete errors, and displays a black screen:
$ glslViewer sample_dof.frag assets/dragon.obj -C assets/Arches_E_PineTree_3k.hdr -e camera_position,-1.43923,0.891203,1.98093
// assets/Arches_E_PineTree_3k.hdr loaded as:
uniform samplerCube u_cubeMap;
uniform vec3 u_SH[9];
FBO: not complete 36054
FBO: not complete 36054
FBO: not complete 36054
// > exit
The View Position (pass) example issues several FBO not complete errors, and displays a black screen:
glslViewer assets/dragon.obj lighting_position.frag -e camera_position,1.43923,-0.891203,-1.98093
FBO: not complete 36054
FBO: not complete 36054
FBO: not complete 36054
FBO: not complete 36054
FBO: not complete 36054
FBO: not complete 36054
// > exit
Final findings for today: I added some debugging statements in deps/vera/src/gl/fbo.cpp
just before the error message and I got this:
$ glslViewer simple.frag -e screenshot,test.png -e exit
// >
GL_DEPTH_COMPONENT32_OES
w=1920, h=1080
FBO: not complete 36054
Screenshot saved to
saving remaining frames to disk, this might take a while ...
where w
is m_width
, h
is m_height
, and GL_DEPTH_COMPONENT32_OES
is the setting for depth_format
.
I'm unable to capture images on Raspberry Pi using glslViewer despite my best efforts. Whatever I try, I get a fully transparent PNG.
I'm using a Raspberry Pi 3B with 1GB RAM, split equally between the CPU and the GPU:
My test frag is as simple as they get:
I need this to run headless, so all my commands start like this (more details on variations later):
If I attach a monitor and I just execute that command I get a yellow screen, as expected. However, if I use any of the capture commands in glslViewer I always get an image or a sequence of images that look like this (note the
min
,max
, andmean
values in the Channel statistics section):Interestingly, if I execute
screenshot
interactively in glslViewer's prompt I can actually see the screen go black forever using this frag; if I use glslViewer's default frag (which is time-dependent), the screen only goes black for a moment while it's taking the blank screenshot.Here are the various CLI commands I attempted, along with their output:
I have tried the following configuration variations with the same results:
cmake -DNO_X11=TRUE ..
andcmake -DNO_X11=TRUE -DFORCE_GBM=TRUE ..
dtoverlay=vc4-kms-v3d
anddtoverlay=vc4-fkms-v3d
in/boot/config.txt
Now here's the kicker: if I just execute
and while that's running I also execute raspi2png
then I do get a proper capture, but only when I use the old
dtoverlay=vc4-fkms-v3d
: