Page 1 of 1
compositor... properties
Posted: Tue Feb 19, 2013 5:49 pm
by endernafi
Hello Dear LiveCoders,
I need a -or more- runrev guru(s).
I'm fiddling around with the below properties for a while now:
compositorCacheLimit,
compositorTileSize,
compositorType.
But I couldn't see any performance benefits.
Here is a sample code:
Code: Select all
on preOpenStack
if the environment is "mobile" then
iphoneUseDeviceResolution true, true
start using stack "animationEngine"
start using stack "kafes"
set the compositorCacheLimit of this stack to 4 * 9 * (4 * (item 1 of the screenLoc) * (item 2 of the screenLoc))
-- 9 is the number of controls of this single-card stack.
set the compositorTileSize of this stack to 128
switch the platform
case "iphone"
set the compositorType of this stack to "opengl"
break
case "android"
set the compositorType of this stack to "software"
break
end switch
set the acceleratedRendering of this stack to true
end if
end preOpenStack
A couple of questions:
* Does the order of these commands make a difference?
Setting the
acceleratedRendering first or last;
or setting the
compositorTileSize before the
compositorCacheLimit, etc.
* What's the best way to determine the values of these properties?
* In which scenarios do these commands create a performance boost?
For example, in a game which consists hundreds of buttons and thousands of sprite png's or ...
Any hints and info much appreciated.
Best,
~ Ender Nafi
Re: compositor... properties
Posted: Tue Feb 19, 2013 9:14 pm
by Simon
Hi Ender,
The dictionary says:
"Use the acceleratedRendering property to put LiveCode into accelerated rendering mode and set the compositor properties to recommended defaults."
That means don't use both.
I'll let someone else answer your other questions, way over my head.
Simon
Re: compositor... properties
Posted: Tue Feb 19, 2013 9:25 pm
by endernafi
Thanks Simon,
I didn't think that way.
But it makes sense, now reading your reply.
One shouldn't use both.
Still wondering though, whether changing that settings makes any performance boost.
I'll post the question in the mail list, too.
There are plenty of gurus there
and I think many of 'em can't find much time to read the forum posts.
Thanks again Simon...
Best,
~ Ender Nafi
Re: compositor... properties
Posted: Wed Feb 20, 2013 12:30 am
by endernafi
Ok,
It was a good decision of me to post this question to the mail-list.
The roundup of Jacque's detailed answer:
*
There's no need to mess around with the compositor properties.
Leaving the defaults as is and using the acceleratedRendering is enough.
But the tricky part is one should use it only when one need it.
*
And here is Thomas McGrath's clarification from another post:
*
1. on preopenCard - set the acceleratedRendering of this stack to true (only on cards that have scrolling or dynamic groups/objects
2. Immediately before moving an object turn on dynamic or when scrolling a group turn on scrolling
once moving the scroll or object has already been cached and drawn so these are no longer necessary.
No need to turn these things on and leave them on because they are not needed and the result is that things will actually slow down.
3. Immediately after moving or scrolling an object turn off the scrolling or dynamic settings
4. on closeCard - set the acceleratedRendering of this stack to false (turn it off since it is not needed)
*
So, here is the recipe:
If you don't have any scrolling groups or moving objects
-> don't turn on acceleratedRendering
and keep the layerMode of controls of the card as static.
If you have a scrolling group
-> turn on acceleratedRendering
and set the layerMode of group {only the topmost group, not the objects of group} to scrolling
immediately before scrolling;
then turn off acceleratedRendering
and set the layerMode of group to static after scrolling.
If you have a couple of moving objects and they move on occasion {i.e. following a click / touch}
-> turn on acceleratedRendering
and set the layerMode of the object(s) to dynamic immediately before the move;
then turn off acceleratedRendering
and set the layerMode of the object(s) to static once the move is done.
If you have multiple moving objects and / or they move constantly
{falling snow particles or rain drops, zooming stars like the Windows' simple screensaver, etc.}
-> turn on acceleratedRendering in the preOpenCard handler
and set the layerMode of the respective object(s) or group(s) to dynamic;
then turn off acceleratedRendering
and set the layerMode of those object(s) and / or group(s) to static
in the closeCard handler.
If I did any mistake or misunderstood the concept, please correct me.
Best,
~ Ender Nafi
Re: compositor... properties
Posted: Tue Feb 26, 2013 7:36 pm
by endernafi
First real world implementation...
The results are spectacular

A 16.000 px high group of news does scroll flawlessly in my low-end test device iPod Touch.
Before this retouch, it was scrolling bumpy.
Btw, each news group contains a 128*128 px picture, two text fields and a button.
Here is a snippet of my code:
Code: Select all
on scrollerBeginDrag
set the layerMode of group "theNews" to "scrolling"
set the acceleratedRendering of this stack to true
end scrollerBeginDrag
on scrollerDidScroll pX, pY
switch mobileControlTarget()
case "theNewsScroller"
set the vScroll of group "theNews" to pY
break
end switch
end scrollerDidScroll
on scrollerEndDecelerate
set the layerMode of group "theNews" to "static"
set the acceleratedRendering of this stack to false
end scrollerEndDecelerate
Thanks everyone, especially Jacque...
Regards,
~ Ender Nafi
Re: compositor... properties
Posted: Tue Feb 26, 2013 10:41 pm
by Jellicle
Ender, that certainly helps with the actual scrolling of my data grids, but there is a slight delay each time the scrolling starts (I have to check for which one of three data grids are being scrolled).
So close
Gerry
Re: compositor... properties
Posted: Wed Feb 27, 2013 2:00 am
by endernafi
So close
So close, indeed
Once I find a solution for that delay, I'll post it here.
Cheers,
~ Ender Nafi
move objects
Posted: Sun Sep 12, 2021 9:23 pm
by samu
how can objects move constantly, and then how can i stop them?