[Bf-gamedev] VideoTexture internal image format

Benoit Bolsee benoit.bolsee at online.be
Thu Oct 15 10:38:29 CEST 2015


Hi All,

As you know, the internal image format used in VideoTexture is RGBA.
During the developments that I'm carrying in the decklink branch, it
came up several times that this format is badly chosen and that BGRA
would be a better choice. The points in favor to the change are:
- the real native OGL format for frame buffer and texture is BGRA,
transferring images with the GPU is faster if the host is also BGRA.
- the Decklink video cards do not support RGBA for the keying frame,
only BGRA.
- Qt does not have a RGBA format, only BGRA

So the change seems necessary. It can mostly be done without changing
the API except for the 'image' attribute of the image source objects
that returns the internal buffer. So the change will break some scripts
but there is already the bge.texture.imageToArray() method that accepts
a mode format. The scripts that require RGBA can be updated by using
this function.
Another solution would be to keep 'image' to return RGBA (via an
inefficient byte swapping) but have another attribute (.e.g 'buffer') to
return internal BGRA buffer.

I would rather break the compatibility but I thought I'd ask the list
first as I have the ambition to bring the decklink branch into trunk.

Benoit





More information about the Bf-gamedev mailing list