Back to Blog
Convert image format for opengl5/30/2023 ![]() This unit hides from your some details about OpenGL images handling. This is our abstraction over OpenGL framebuffer (or glCopyTexSubImage for ancient GPUs). Render to texture, see TGLRenderToTexture class. You usually use this through TCastleWindow.SaveScreen or TCastleControl.SaveScreen, based on SaveScreen_NoFlush in this unit. Save the current OpenGL screen contents to our TCastleImage. This is useful to implement various 2D controls. These functions wrap OpenGL calls like glTexImage2D to handle our images ( TEncodedImage (and descendant TCastleImage), TCompositeImage), and to automatically set texture parameters, mipmaps and such. You usually do not use these directly, instead TCastleScene automatically uses these to load and render textures as part of 3D models.Ī lot of utilities included: for 2D textures (see LoadGLTexture), cube maps (see glTextureCubeMap), 3D textures (see glTextureImage3D). They contain functions and classes to load, save and process images. For further information on this group, click here.Using images in OpenGL (as textures and as normal images).įor non-OpenGL image management, see CastleImages and CastleTextureImages units. Show is an engineer within the Multimedia Working Group. ![]() On the RockPi4b platform the frame rate reached 30.0x fps with the capture resolution set to 1920x1080. The code has already been merged into the libcamera git tree, but if you’re interested in the specific patches that implement what we’ve talked about in this post then please take a look at the following commitsĪfter moving the format conversion to the GPU, the qcam frame rate improved a lot. (char *)yuvData_ + size_.width() * size_.height()) ![]() ShaderProgram_.setUniformValue(textureUniformY_, 0) The new class is inherited from QOpenGLWidget and QOpenGLFunctions. To enable the OpenGL support for “qcam”, the QOpenGLWidget, QOpenGLFunctions and QOpenGLShaderProgram 3 main Qt OpenGL components would be added to handle the OpenGL format convert and frame rendering. OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00 OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.2.0-devel (git-14a12b771d) OpenGL shading language version string: 1.20 OpenGL renderer string: Mali T860 (Panfrost) Linux manjaro 5.8.11-00001-g9a8f115558ca #2 SMP PREEMPT Thu Sep 24 11:12:31 CSTĮxtended renderer info (GLX_MESA_query_renderer):ĭevice: Mali T860 (Panfrost) (0xffffffff) Also we ensure the GPU driver is enabled in the kernel. The Panfrost driver requires the Linux kernel version to be higher than v5.2. Also this would make a demo that nicely combines libcamera with some of the great work that has happened recently in Mesa on the Panfrost GPU driver. ![]() Moving these heavy loading tasks to the GPU would be more efficient and there are already lots of examples about sharing the loading with the GPU that can be referenced. If the capture frame size is set to 1920 x 1080, the frame rate is even down to around 2.0x fpsĪs libcamera is helping to solve a longstanding pain point in the Linux ecosystem (the management of complex cameras), we decided to contribute to accelerating Qcam so we can have a much more performant demo of libcamera on some of the platforms Linaro cares about. If the capture frame size is set to 1280 x 720, the frame rate is around 4.5x fps. For example when doing the conversion on the CPU of a RockPi4B which has a RKI3399 SoC, we get the following framerates in QCam: If the capture frame size is set to 640 x 480, the frame rate is around 13.4x fps. However, the default CPU software conversion is not very efficient.
0 Comments
Read More
Leave a Reply. |