Hi Ulrich,
The BGRA support is currently a bit half-done -- the `GL::PixelFormat` has it, but not the generic `Magnum::PixelFormat` (yet -- those formats were originally added for TGA but caused so much pain that I ended up swizzing to RGBA on import instead). There are also various extensions providing these formats for OpenGL ES and WebGL that I have on my TODO list, but it's quite a mess and I didn't have a chance to look at that deeply yet.
Checking the OpenGL wiki, passing `GL::PixelFormat::BGRA` to `GL::TextureFormat::RGBA8` should actually work -- see
https://www.khronos.org/opengl/wiki/Textures_-_more . There's no source for that though, but checking the spec and the full GL extension list, there isn't anything that would provide `GL::TextureFormat::BGRA8` (on desktop, that is -- OpenGL ES on the other hand *has* such extensions). Can you try if that works for you? I'll update the docs to make this more clear.
Alternatively (if the above doesn't work, but I'm pretty sure it would), there's `GL::Texture::setSwizzle()` that allows you to remap the components. So if you would load as `PixelFormat::RGBA`, then you could do `texture.setSwizzle<'b', 'g', 'r', 'a'>()` to reorder the components to the proper place.
Hope this helps!
Vladimir
______________________________________________________________
> Od: "Ulrich Eck" <
ulri...@gmail.com>
> Komu: "Magnum Graphics Engine" <
magnum...@googlegroups.com>
> Datum: 03.10.2019 16:26
> Předmět: [magnum] Efficient rendering of BGR(A) buffers in OpenGL?
>--
>You received this message because you are subscribed to the Google Groups "Magnum Graphics Engine" group.
>To unsubscribe from this group and stop receiving emails from it, send an email to
magnum-engin...@googlegroups.com.
>To view this discussion on the web visit
https://groups.google.com/d/msgid/magnum-engine/e526d3ae-91e8-4a17-bc03-444be5d1b3af%40googlegroups.com.
>
>