Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - zcream

Pages: [1]
1
There is a comparison of direct OpenGL methods here - https://stackoverflow.com/questions/68791782/fastest-way-to-transfer-buffer-texture-data-from-gpu-to-cpu

1)Using glReadPixels - < 3.1ms

   glBindTexture(GL_TEXTURE_2D,depthTexture);
   glReadPixels(0, 0, width, height, GL_DEPTH_COMPONENT, GL_FLOAT,mat.data);
 

2)Using glGetTexImage - <2.9ms

glBindTexture(GL_TEXTURE_2D,depthTexture);
glGetTexImage(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, GL_FLOAT, mat.data);
 

3)Using PBO with glGetTexImage - <2.3ms

glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo);
glBindTexture(GL_TEXTURE_2D, depthTexture);
glGetTexImage(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0);
mat.data = (uchar*)glMapBuffer(GL_PIXEL_PACK_BUFFER, GL_READ_ONLY);
 

2
Thats an image buffer of
uint8_t * pixels
a. Copy image buffer to Texture
 
void sf::Texture::update        (       const Uint8 *   pixels  )

b. Render using SFML to texture

c. Copy sf::Texture to sf::Image

or
a. Use sf::Image with you buffer copied to sf::Image
b. Copy sf::Image to sf::Texture
c. Copy sf::Texture to sf::Image


Are these the two options you described ?

3
Graphics / Use SFML in a video processing pipeline - use offscreen buffer
« on: October 08, 2021, 01:51:25 pm »
In my application, I originally obtain an image buffer on the CPU. This is then copied over to SFML - processed with overlays, and then copied back to CPU image buffer.
I looked at sf::Image and sf::RenderTexture. If I understand this correctly, I need to
a. Copy CPU Image Buffer to sf::Image
b. Copy sf::Image to sf::RenderTexture
c. Process overlays in sf::RenderTexture
d. Copy sf::RenderTexture to sf::Image
e. Copy sf::Image to CPU Image Buffer

Does this sound correct ? Is there a sample code for someone using SFML in an image processing pipeline ?

Pages: [1]
anything