readPixels doesn't works with Luminance(Alpha)Texture

Hi. I found readPixels method of RawTexture is not working when created by RawTexture.CreateLuminanceTexture.
readPixels returns array filled by zero and throw warning message like GL_INVALID_FRAMEBUFFER_OPERATION: Framebuffer is incomplete: Attachment is not renderable.
image

Also I checked that it is works properly when RawTexture.CreateRGBATexture .
image

I created a Playground for representation below.

And tested environment is below

  • OS: Windows 11 Home
  • Browser: Chrome 109.0.5414.75
  • Babylon.js: 5.43.0

I wanto to know this is whether bug or specification.
Thank you!

It seems luminance is not a color renderable format, so we can’t read from it.

Anyway, luminance is deprecated since OpenGL 3.2 and not supported in WebGPU. So, if possible (meaning, if you don’t have to support WebGL1), you should use a format like RED instead (CreateRTexture in Babylon).

1 Like

Thank you @Evgeni_Popov .

luminance is not a color renderable format

I see. I haven’t heard of the word color readable because I’m not familier with WebGL programming.
This is very helpful!

I’ll use the RTexture format instead.