Closed lemoon closed 1 year ago
Hi,
the primary function in LLGL to retrieve texture data from the GPU is RenderSystem::ReadTexture
. You can either render into a texture directly using a RenderTarget
or read from the framebuffer (similar to glReadPixels
) by copying the contents of the framebuffer into a texture using CopyTextureFromFramebuffer
. Either way you will have to work with an instance of the Texture
interface.
You can also take a look at how ExampleBase
does it: First capture the frame via CaptureFramebuffer
, then save the texture to a PNG file in SaveTextureWithRenderer
.
Hope that answers your questions. Laura
Hi,
the primary function in LLGL to retrieve texture data from the GPU is
RenderSystem::ReadTexture
. You can either render into a texture directly using aRenderTarget
or read from the framebuffer (similar toglReadPixels
) by copying the contents of the framebuffer into a texture usingCopyTextureFromFramebuffer
. Either way you will have to work with an instance of theTexture
interface.You can also take a look at how
ExampleBase
does it: First capture the frame viaCaptureFramebuffer
, then save the texture to a PNG file inSaveTextureWithRenderer
.Hope that answers your questions. Laura
Thank you, this is very helpful to me.
And i found an unfinished implementation here (https://github.com/LukasBanana/LLGL/blob/master/sources/Renderer/OpenGL/Texture/GLTexture.cpp#L834), could this cause some platforms to not correctly read GPU data?
This is not implemented for OpenGLES yet but desktop OpenGL is fine. It shouldn't take too long to implement it for GLES, though.
@lemoon did you run into this exception or how did you find this unimplemented function? In other words, how urgent do you need this functionality for GLES?
Can this ticket be closed or is there still an issue with reading back framebuffer data?
@lemoon did you run into this exception or how did you find this unimplemented function? In other words, how urgent do you need this functionality for GLES?
Hi, LukasBanana. I expect to run on multiple platforms, including Android, MacOS, Windows, iOS, and Linux. So there is a high probability that this feature will be used on some low-end devices.
Can this ticket be closed or is there still an issue with reading back framebuffer data?
You can close this issue for now, and I will provide specific feedback based on the specific scenario in the future.
Hi,all. Currently, there is a need to develop a mechanism to read the rendered images from the GPU back to the CPU, similar to the functionality provided by glReadPixels in OpenGL. This feature would enable efficient data transfer and processing between the GPU and CPU, allowing for further analysis, manipulation, or storage of the rendered images on the CPU side.