[Bf-gamedev] VideoTexture internal image format
Benoit Bolsee
benoit.bolsee at online.be
Fri Oct 16 10:11:12 CEST 2015
I spoke too quickly it seems: while converting the format to BGRA I
noticed that it creates a lot of difficulty with ImageBuff source: raw
images are manipulated here with the help of IMB_* functions that are
all RGBA based. It's too much trouble to change.
So I abandon the idea of changing the internal image format. Instead I
will instead create specific functions to extract the frame buffer in
BGRA format. That is is mostly what is needed.
Sorry for the noise.
On Thu, 2015-10-15 at 09:13 -0300, Dalai Felinto wrote:
> > 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 still favour this approach even if "everything else will just
> be as before". There is no strong reason to break the API here if I
> got it correctly (and of course in the function doc we mention that
> buffer is a more optimized format).
>
> my 2 cents anyways
> --
> blendernetwork.org/dalai-felinto
> www.dalaifelinto.com
>
>
> 2015-10-15 8:22 GMT-03:00 Benoit Bolsee <benoit.bolsee at online.be>:
> > Yes, everything else will just be as before. The change in the internal
> > representation will be reflected in all internal OGL & ffmpeg, calls so
> > that there is no visual change.
> >
> > On Thu, 2015-10-15 at 08:06 -0300, Dalai Felinto wrote:
> >> Hi Benoit,
> >>
> >> Apart from the API change would everything else just work as before?
> >>
> >> For example, if I was using video texture to swap a texture from one
> >> in the HD, or by data from imagerender would they keep working?
> >>
> >> On Oct 15, 2015 05:38, "Benoit Bolsee" <benoit.bolsee at online.be>
> >> wrote:
> >> 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
> >>
> >>
> >>
> >> _______________________________________________
> >> Bf-gamedev mailing list
> >> Bf-gamedev at blender.org
> >> http://lists.blender.org/mailman/listinfo/bf-gamedev
> >> _______________________________________________
> >> Bf-gamedev mailing list
> >> Bf-gamedev at blender.org
> >> http://lists.blender.org/mailman/listinfo/bf-gamedev
> >
> >
> > _______________________________________________
> > Bf-gamedev mailing list
> > Bf-gamedev at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-gamedev
> _______________________________________________
> Bf-gamedev mailing list
> Bf-gamedev at blender.org
> http://lists.blender.org/mailman/listinfo/bf-gamedev
More information about the Bf-gamedev
mailing list