Page 1 of 1

The state of the Graphics Engine

Posted: Wed Jun 22, 2011 3:43 pm
by Sjatplat
Hi
Does anyone know if the revteam is working on a new graphics engine? I have a game idea for the Ipad that doesn't require 3d but I do need to manipulate an image on pixel level. The graphics engine is good enough if you want to build an interface or a slideshow, or maybe a couple of moving sprites - anything over that (or deeper) seems almost impossible - or at least awkward. As great as Malte's Animation engine is, the livecode graphics capabilities is a bottleneck.

Having the opportunity to build for mobile devices is fantastic - but a great part of the mobile market is games and media.

I love livecode - but shouldn't this part of the engine get a boost soon?

Re: The state of the Graphics Engine

Posted: Wed Jun 22, 2011 5:53 pm
by Mark
Hi,

Direct rendering on screen, without the use of objects, is one of my greatest wishes. I don't think this will EVER happen.

The graphics engine has been improved in a recent version of Revolution. I don't expect a complete overhaul anytime soon.

Best,

Mark

Re: The state of the Graphics Engine

Posted: Wed Jun 22, 2011 7:33 pm
by bn
HI,

there was talk of an overhaul of the graphics engine for exactly the reasons you stated. To speed up the user experience on mobile OSs. Especially graphic effects greatly impact the rendering times in mobile OSs. As a welcome side effect the engine also will be faster on the desktop. I don't know if direct pixel access is also in the works. It would be desirable. To manipulate imageData is not too hard but rendering of images with alpha data in iOS is too slow to be useful.

Kind regards

Bernd

Re: The state of the Graphics Engine

Posted: Wed Jun 22, 2011 10:58 pm
by BvG
direct pixel access is possible, when using image objects. however, it is horribly slow, and unsuitable for anything but the most basic of animations. There are some example stacks in revonline that do fancy effects to images, I suggest to check them out, to see what is possible.

If there where a faster way to do things in images, that'd be a boon.

Re: The state of the Graphics Engine

Posted: Thu Jun 23, 2011 12:48 am
by Sjatplat
Thank you all for the replies

Great to read, at least, there was some talk about this. And that I'm not the only one wishing for this. I imagine, even if I'm needy and biased, that some form of low level manipulation in the engine would speed things up. Something that could be used to create a new library like the animationEngine.

I'm moving from "new feature" to "how to" now, but as I understand it (I'm not a seasoned programmer), imageData is in itself a conversion of the image and not the raw data of the image itself. So if you want to manipulate an Image you have to recode the complete imageData? or is it possible to just insert some numbers to the imageData with binaryDecode/encode (+ chunk expressions)?

In my view, redrawing an image should be handled in the engine and manipulating pixel x,x with color x.x.x should be available in livecode. Speed in gaming is all about drawing only what you have to draw.

I've searched and read, but I'm still not sure how fast redrawing 1024x768 pixels for the ipad in a livecode repeat loop is. My guess is that since imagedata is a conversion in itself combined with repeat loop of redrawing the whole image, you have 2 extra procedures going in 'high level".....?

Best and thanks,

Sjat

Re: The state of the Graphics Engine

Posted: Thu Jun 23, 2011 8:29 am
by bn
Hi Sjat,

Have a look at these links:

Colin shows how he manipulates imageData for an app that paints into an image. This is not a fullblown app but shows how to manipulate imageData

more important there are also links to the stacks he shows in the recording for download. That way you have some code to play around with.

http://blog.livecode.tv/2011/03/event-16-wrapup/

http://blog.livecode.tv/2011/04/172/

working with imageData is not obvious at first but once you get your head around how it is made up it is fairly easy. Look it up in the dictionary and look at the examples.

Currently the process is too slow to be acceptable on the iPad, but it does run on the iPad. Frame rates are about 4 to 5 per second in an iPad 1st gen with an image size of 640*480.

Kind regards

Bernd

Re: The state of the Graphics Engine

Posted: Thu Jun 30, 2011 11:16 pm
by Sjatplat
Thanks Bernd,
(and Colin)

Great stacks there. Clean and simple. They also confirm that I have to think again about my idea. "imageData" is both slow and awkward to be useful. I guess I'll look for another language for this project.

Sjat