PDA

View Full Version : RGBA array -> TBGL window (yet another question)



RobbeK
14-10-2013, 23:37
Hi all,

I could speed up the Julia2D benchmark around 4-6x by using a shared array between oxygen and TBGL.
Probably, if TBGL can load and convert RGBA ( ... .r , .g , .b , .a ... ) arrays fast and easy, the speed should increase.
Is there some info about this ?
Is it faster than reading (by the interpreter) than an array of rgb values ? (this needs width x height cycles)

thanks in advance, Rob

Petr Schreiber
15-10-2013, 08:45
Hi Rob,

I think for per-pixel graphics the Canvas might be better choice - you can use Canvas_BitmapSet to perform such an assignment.

In TBGL, you could do something similar, although I am not sure about the bus transfer penalty. Please check out the TBGL_MakeTexture - it allows to define texture from memory (even RGBA buffer). Then all you need to do is to map the texture to fullscreen quad.


Petr

RobbeK
15-10-2013, 14:25
Thanks again,

The speed of the canvas method is rather low if working with an array. (attached : TBGL outperforms it in a convincing way).
I had no idea the canvas method was that slow (and also explains the performance of that piece of PowerBasic code -- all the other samples used OpenGL (iirc) ).
I think to remember (about a decade ago) , some compilers had Pixel and PixelFast methods. Maybe the PixelFast poked directly into the specific video segment ? (iirc there was no boundary check and one had to be careful with this method ) -- I'll see I can setup something similar. Maybe the bitmap roundabout is a good starter (I'm slowly catching up the "modern" techniques - I stopped programming when windows changed from 16 to 32 bit ;-)

best , Rob

RobbeK
15-10-2013, 18:23
Wow, great performance !
(that's what i needed - it may be faster than the GFA compiler, same league as GNU assembler)


thanks for your help --

(oops, yes, had some problems with dynamic length strings inside Oxygen - had to make them static )