2

I'm trying to retrieve a Pixel-value from a Renderbuffer attached to an unbound Framebuffer. Since I'm trying to avoid changing global state when reading said value I'm unable to use glReadPixels([...]) which would normally be used to read Pixels from the currently bound Framebuffer.

DirectStateAccess methods usually solve this problem but I'm unable to locate a method that allows for directly specifying the source of the read operation.

Is it possible to read the pixel in a different way, without having to bind the associated Framebuffer? Why did this method not get included in the DSA extension?

Majid Hajibaba
  • 3,105
  • 6
  • 23
  • 55
  • "*Pixel-value from a Renderbuffer attached to an unbound Framebuffer.*" Is there a reason you couldn't do the read while it was bound? – Nicol Bolas May 21 '21 at 13:42

1 Answers1

1

If the framebuffer attachment is a Texture and not a Rrenderbuffer, you can read the pixel data from the texture object instead of the framebuffer with glGetTextureImage.

Rabbid76
  • 202,892
  • 27
  • 131
  • 174