NME rotation best practices

classic Classic list List threaded Threaded
33 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

alexbor
Gamehaxe wrote
Hi,
If you are after exact vector rotations on bitmaps, you could also  
consider only
doing 0...90, because 90 degree rotations should still maintain
pixel-perfect results.  The BitmapData matrices would be easy to calculate.

Hugh
Do you mean creating separate sprite for each game object (create sprite; add to display list; draw 0...90 tilesheet; apply 90, 180 or 270 rotation)? If so then it causes many library calls. Testing this technic on windows shows 20 fps (drawTriangles shows 40).
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Chman
In reply to this post by Gamehaxe
Would it be possible to add an optional alpha value to the array as well ? Because I'm working on a particle system right now, using drawTiles() to render in one draw call, but I can't figure out how to add transparency to individual particles to make them fade away...

- Tom



Gamehaxe wrote
If you are happy to rotate the bitmap (rather than the vectors),
I was thinking of adding optional scale, rotation and maybe color
to the inXYID array of Graphics.drawTiles.
This would make a pretty simple API.

Hugh


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Missile Mike
In reply to this post by alexbor
Just getting back to reading this now....  Good job, Alex, and your conclusion is the same as mine- drawTriangles is the best current method.  It also supports vertex coloring and alpha, in addition to being able to scale and rotate.  So yeah, using a sprite sheet with all your images crammed on there, and then using drawTriangles is the way to go.  Also, you need to be careful about how many times you call BeginBitmapFill, because it's a performance hit on iOS for each time it's called.

Hugh:  If these were all added to drawtiles(), it would make things a lot easier.
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Alex Liebert
I wanted to throw my 2 cents in and say that having a rotation and scale option in drawTiles() would be a fantastic feature.  Currently I've also been using Bitmap objects where rotation was important and drawTiles for everything else.



On Fri, Oct 14, 2011 at 2:14 PM, Missile Mike <[hidden email]> wrote:
Just getting back to reading this now....  Good job, Alex, and your
conclusion is the same as mine- drawTriangles is the best current method.
It also supports vertex coloring and alpha, in addition to being able to
scale and rotate.  So yeah, using a sprite sheet with all your images
crammed on there, and then using drawTriangles is the way to go.  Also, you
need to be careful about how many times you call BeginBitmapFill, because
it's a performance hit on iOS for each time it's called.

Hugh:  If these were all added to drawtiles(), it would make things a lot
easier.

--
View this message in context: http://haxe.1354130.n2.nabble.com/NME-rotation-best-practices-tp6880337p6894074.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Heinz Hölzer-2
rotation, scale and alpha would be fantastic ;)

Am 14.10.2011 23:37, schrieb Alex Liebert:
I wanted to throw my 2 cents in and say that having a rotation and scale option in drawTiles() would be a fantastic feature.  Currently I've also been using Bitmap objects where rotation was important and drawTiles for everything else.



On Fri, Oct 14, 2011 at 2:14 PM, Missile Mike <[hidden email]> wrote:
Just getting back to reading this now....  Good job, Alex, and your
conclusion is the same as mine- drawTriangles is the best current method.
It also supports vertex coloring and alpha, in addition to being able to
scale and rotate.  So yeah, using a sprite sheet with all your images
crammed on there, and then using drawTriangles is the way to go.  Also, you
need to be careful about how many times you call BeginBitmapFill, because
it's a performance hit on iOS for each time it's called.

Hugh:  If these were all added to drawtiles(), it would make things a lot
easier.

--
View this message in context: http://haxe.1354130.n2.nabble.com/NME-rotation-best-practices-tp6880337p6894074.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org





--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Alex Liebert
I wanted to bump this thread and see if the additional transform options on tilesheets hugh mentioned are in the works.  

thanks!

Alex


2011/10/14 Heinz Hölzer <[hidden email]>
rotation, scale and alpha would be fantastic ;)

Am 14.10.2011 23:37, schrieb Alex Liebert:
I wanted to throw my 2 cents in and say that having a rotation and scale option in drawTiles() would be a fantastic feature.  Currently I've also been using Bitmap objects where rotation was important and drawTiles for everything else.



On Fri, Oct 14, 2011 at 2:14 PM, Missile Mike <[hidden email]> wrote:
Just getting back to reading this now....  Good job, Alex, and your
conclusion is the same as mine- drawTriangles is the best current method.
It also supports vertex coloring and alpha, in addition to being able to
scale and rotate.  So yeah, using a sprite sheet with all your images
crammed on there, and then using drawTriangles is the way to go.  Also, you
need to be careful about how many times you call BeginBitmapFill, because
it's a performance hit on iOS for each time it's called.

Hugh:  If these were all added to drawtiles(), it would make things a lot
easier.

--
View this message in context: http://haxe.1354130.n2.nabble.com/NME-rotation-best-practices-tp6880337p6894074.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org





--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Elsass Philippe

New transformations work great:
http://philippe.elsass.me/2011/11/nme-ready-for-the-show/

On Nov 19, 2011 6:27 AM, "Alex Liebert" <[hidden email]> wrote:
>
> I wanted to bump this thread and see if the additional transform options on tilesheets hugh mentioned are in the works.  
>
> thanks!
>
> Alex
>
>
> 2011/10/14 Heinz Hölzer <[hidden email]>
>>
>> rotation, scale and alpha would be fantastic ;)
>>
>> Am 14.10.2011 23:37, schrieb Alex Liebert:
>>>
>>> I wanted to throw my 2 cents in and say that having a rotation and scale option in drawTiles() would be a fantastic feature.  Currently I've also been using Bitmap objects where rotation was important and drawTiles for everything else.
>>>
>>>
>>>
>>> On Fri, Oct 14, 2011 at 2:14 PM, Missile Mike <[hidden email]> wrote:
>>>>
>>>> Just getting back to reading this now....  Good job, Alex, and your
>>>> conclusion is the same as mine- drawTriangles is the best current method.
>>>> It also supports vertex coloring and alpha, in addition to being able to
>>>> scale and rotate.  So yeah, using a sprite sheet with all your images
>>>> crammed on there, and then using drawTriangles is the way to go.  Also, you
>>>> need to be careful about how many times you call BeginBitmapFill, because
>>>> it's a performance hit on iOS for each time it's called.
>>>>
>>>> Hugh:  If these were all added to drawtiles(), it would make things a lot
>>>> easier.
>>>>
>>>> --
>>>> View this message in context: http://haxe.1354130.n2.nabble.com/NME-rotation-best-practices-tp6880337p6894074.html
>>>> Sent from the Haxe mailing list archive at Nabble.com.
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>
>>>
>>>
>>>
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Tarwin Stroh-Spijer
Great post Philippe ! Thanks!


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Sat, Nov 19, 2011 at 1:16 AM, Philippe Elsass <[hidden email]> wrote:

New transformations work great:
http://philippe.elsass.me/2011/11/nme-ready-for-the-show/

On Nov 19, 2011 6:27 AM, "Alex Liebert" <[hidden email]> wrote:
>
> I wanted to bump this thread and see if the additional transform options on tilesheets hugh mentioned are in the works.  
>
> thanks!
>
> Alex
>
>
> 2011/10/14 Heinz Hölzer <[hidden email]>
>>
>> rotation, scale and alpha would be fantastic ;)
>>
>> Am 14.10.2011 23:37, schrieb Alex Liebert:
>>>
>>> I wanted to throw my 2 cents in and say that having a rotation and scale option in drawTiles() would be a fantastic feature.  Currently I've also been using Bitmap objects where rotation was important and drawTiles for everything else.
>>>
>>>
>>>
>>> On Fri, Oct 14, 2011 at 2:14 PM, Missile Mike <[hidden email]> wrote:
>>>>
>>>> Just getting back to reading this now....  Good job, Alex, and your
>>>> conclusion is the same as mine- drawTriangles is the best current method.
>>>> It also supports vertex coloring and alpha, in addition to being able to
>>>> scale and rotate.  So yeah, using a sprite sheet with all your images
>>>> crammed on there, and then using drawTriangles is the way to go.  Also, you
>>>> need to be careful about how many times you call BeginBitmapFill, because
>>>> it's a performance hit on iOS for each time it's called.
>>>>
>>>> Hugh:  If these were all added to drawtiles(), it would make things a lot
>>>> easier.
>>>>
>>>> --
>>>> View this message in context: http://haxe.1354130.n2.nabble.com/NME-rotation-best-practices-tp6880337p6894074.html
>>>> Sent from the Haxe mailing list archive at Nabble.com.
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>
>>>
>>>
>>>
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Joe Dohn
In reply to this post by Elsass Philippe
Interesting post :)

You say NME is more feature complete than Starling, but what about performance? Starling may be beaten with such small images in such great quantities, but what about larger images? It's apparently where Starling would get to shine according to comments 38 and 40 of this blog post: http://www.bytearray.org/?p=3371

Although, from #38: "Of course, as soon as I move up to larger objects, Starling wins easily, taking no hit as objects get larger."
NME wouldn't take a hit either would it? (I never used NME yet)

Either way I'm still curious about Philippe's own blog post test case adapted to Starling, if anyone gave it a try. Even if it's not Starling's strong point, I'd like to see how bad it is beaten by NME. And then some test with bigger images or something, unless it's unwarranted.



From: Philippe Elsass <[hidden email]>
To: The haXe compiler list <[hidden email]>
Sent: Saturday, November 19, 2011 10:16 AM
Subject: Re: [haXe] Re: NME rotation best practices

New transformations work great:
http://philippe.elsass.me/2011/11/nme-ready-for-the-show/

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Elsass Philippe
Drawing a few large elements in NME and Starling should behave similarly because it's mostly GPU working (openGl in both cases).

Starling/Stage3D problems arises because of AS3 overhead when uploading geometry on the GPU - that's where NME's C++ output shines.

That said, if you're going to need complex program shaders you'll want to use Starling/ND2D because currently NME is in openGL ES1 which doesn't support programmable shaders (but then it supports more devices).


FYI I've actually written an optimized Image Batch for Starling - you can try it with bunnies ;)


On Tue, Nov 22, 2011 at 9:20 AM, Joe Dohn <[hidden email]> wrote:
Interesting post :)

You say NME is more feature complete than Starling, but what about performance? Starling may be beaten with such small images in such great quantities, but what about larger images? It's apparently where Starling would get to shine according to comments 38 and 40 of this blog post: http://www.bytearray.org/?p=3371

Although, from #38: "Of course, as soon as I move up to larger objects, Starling wins easily, taking no hit as objects get larger."
NME wouldn't take a hit either would it? (I never used NME yet)

Either way I'm still curious about Philippe's own blog post test case adapted to Starling, if anyone gave it a try. Even if it's not Starling's strong point, I'd like to see how bad it is beaten by NME. And then some test with bigger images or something, unless it's unwarranted.



From: Philippe Elsass <[hidden email]>
To: The haXe compiler list <[hidden email]>
Sent: Saturday, November 19, 2011 10:16 AM
Subject: Re: [haXe] Re: NME rotation best practices

--
haXe - an open source web programming language
http://haxe.org



--
Philippe

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Joe Dohn
In reply to this post by Elsass Philippe
Heh those 8K particles in your demo are lovely. I'll keep those in mind for later today.

"Starling/Stage3D problems arises because of AS3 overhead when uploading geometry on the GPU - that's where NME's C++ output shines."
Just curious, does NME's C++ run like C++ code with Alchemy on Flash 10? If so it's impressive that you achieve better results than Starling which uses Stage3D. Well I guess part of the feat is haXe magic :)

Err also, I'm kind of getting a little off topic now but, how would you go about using 3D models in a 2D environment? Can Starling do that alone? I'm only starting to dig Starling and NME but I was under the impression that if I'm using Starling there will be no "easy" high level way to use 3D models. What about NME? (Ignoring the current lack of custom shaders support)

Thanks for your help and all your open source stuff!
(Sorry, darn Yahoo made me send this message personally to you so you got it twice)



From: Philippe Elsass <[hidden email]>
To: The haXe compiler list <[hidden email]>
Sent: Saturday, November 19, 2011 10:16 AM
Subject: Re: [haXe] Re: NME rotation best practices

On Nov 19, 2011 6:27 AM, "Alex Liebert" <[hidden email]> wrote:
>
> I wanted to bump this thread and see if the additional transform options on tilesheets hugh mentioned are in the works.  
>
> thanks!
>
> Alex
>
>
> 2011/10/14 Heinz Hölzer <[hidden email]>
>>
>> rotation, scale and alpha would be fantastic ;)
>>
>> Am 14.10.2011 23:37, schrieb Alex Liebert:
>>>
>>> I wanted to throw my 2 cents in and say that having a rotation and scale option in drawTiles() would be a fantastic feature.  Currently I've also been using Bitmap objects where rotation was important and drawTiles for everything else.
>>>
>>>
>>>
>>> On Fri, Oct 14, 2011 at 2:14 PM, Missile Mike <[hidden email]> wrote:
>>>>
>>>> Just getting back to reading this now....  Good job, Alex, and your
>>>> conclusion is the same as mine- drawTriangles is the best current method.
>>>> It also supports vertex coloring and alpha, in addition to being able to
>>>> scale and rotate.  So yeah, using a sprite sheet with all your images
>>>> crammed on there, and then using drawTriangles is the way to go.  Also, you
>>>> need to be careful about how many times you call BeginBitmapFill, because
>>>> it's a performance hit on iOS for each time it's called.
>>>>
>>>> Hugh:  If these were all added to drawtiles(), it would make things a lot
>>>> easier.
>>>>
>>>> --
>>>> View this message in context: http://haxe.1354130.n2.nabble.com/NME-rotation-best-practices-tp6880337p6894074.html
>>>> Sent from the Haxe mailing list archive at Nabble.com.
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>
>>>
>>>
>>>
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Tarwin Stroh-Spijer
Alas, there is no 3D engine for NME as yet, though some people in the community are slowly working on one in their spare time.

Flash (Molehill) has Away3D 4 as well as some other engines.


Tarwin Stroh-Spijer
_______________________

Touch My Pixel
http://www.touchmypixel.com/
phone: +61 3 8060 5321
_______________________


On Tue, Nov 22, 2011 at 2:49 AM, Joe Dohn <[hidden email]> wrote:
Heh those 8K particles in your demo are lovely. I'll keep those in mind for later today.

"Starling/Stage3D problems arises because of AS3 overhead when uploading geometry on the GPU - that's where NME's C++ output shines."
Just curious, does NME's C++ run like C++ code with Alchemy on Flash 10? If so it's impressive that you achieve better results than Starling which uses Stage3D. Well I guess part of the feat is haXe magic :)

Err also, I'm kind of getting a little off topic now but, how would you go about using 3D models in a 2D environment? Can Starling do that alone? I'm only starting to dig Starling and NME but I was under the impression that if I'm using Starling there will be no "easy" high level way to use 3D models. What about NME? (Ignoring the current lack of custom shaders support)

Thanks for your help and all your open source stuff!
(Sorry, darn Yahoo made me send this message personally to you so you got it twice)



From: Philippe Elsass <[hidden email]>
To: The haXe compiler list <[hidden email]>
Sent: Saturday, November 19, 2011 10:16 AM
Subject: Re: [haXe] Re: NME rotation best practices

On Nov 19, 2011 6:27 AM, "Alex Liebert" <[hidden email]> wrote:
>
> I wanted to bump this thread and see if the additional transform options on tilesheets hugh mentioned are in the works.  
>
> thanks!
>
> Alex
>
>
> 2011/10/14 Heinz Hölzer <[hidden email]>
>>
>> rotation, scale and alpha would be fantastic ;)
>>
>> Am 14.10.2011 23:37, schrieb Alex Liebert:
>>>
>>> I wanted to throw my 2 cents in and say that having a rotation and scale option in drawTiles() would be a fantastic feature.  Currently I've also been using Bitmap objects where rotation was important and drawTiles for everything else.
>>>
>>>
>>>
>>> On Fri, Oct 14, 2011 at 2:14 PM, Missile Mike <[hidden email]> wrote:
>>>>
>>>> Just getting back to reading this now....  Good job, Alex, and your
>>>> conclusion is the same as mine- drawTriangles is the best current method.
>>>> It also supports vertex coloring and alpha, in addition to being able to
>>>> scale and rotate.  So yeah, using a sprite sheet with all your images
>>>> crammed on there, and then using drawTriangles is the way to go.  Also, you
>>>> need to be careful about how many times you call BeginBitmapFill, because
>>>> it's a performance hit on iOS for each time it's called.
>>>>
>>>> Hugh:  If these were all added to drawtiles(), it would make things a lot
>>>> easier.
>>>>
>>>> --
>>>> View this message in context: http://haxe.1354130.n2.nabble.com/NME-rotation-best-practices-tp6880337p6894074.html
>>>> Sent from the Haxe mailing list archive at Nabble.com.
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>
>>>
>>>
>>>
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: NME rotation best practices

Elsass Philippe
In reply to this post by Joe Dohn

No, NME Flash output is regular haxe SWF generation.

On Nov 22, 2011 11:50 AM, "Joe Dohn" <[hidden email]> wrote:
Heh those 8K particles in your demo are lovely. I'll keep those in mind for later today.

"Starling/Stage3D problems arises because of AS3 overhead when uploading geometry on the GPU - that's where NME's C++ output shines."
Just curious, does NME's C++ run like C++ code with Alchemy on Flash 10? If so it's impressive that you achieve better results than Starling which uses Stage3D. Well I guess part of the feat is haXe magic :)

Err also, I'm kind of getting a little off topic now but, how would you go about using 3D models in a 2D environment? Can Starling do that alone? I'm only starting to dig Starling and NME but I was under the impression that if I'm using Starling there will be no "easy" high level way to use 3D models. What about NME? (Ignoring the current lack of custom shaders support)

Thanks for your help and all your open source stuff!
(Sorry, darn Yahoo made me send this message personally to you so you got it twice)



From: Philippe Elsass <[hidden email]>
To: The haXe compiler list <[hidden email]>
Sent: Saturday, November 19, 2011 10:16 AM
Subject: Re: [haXe] Re: NME rotation best practices

On Nov 19, 2011 6:27 AM, "Alex Liebert" <[hidden email]> wrote:
>
> I wanted to bump this thread and see if the additional transform options on tilesheets hugh mentioned are in the works.  
>
> thanks!
>
> Alex
>
>
> 2011/10/14 Heinz Hölzer <[hidden email]>
>>
>> rotation, scale and alpha would be fantastic ;)
>>
>> Am 14.10.2011 23:37, schrieb Alex Liebert:
>>>
>>> I wanted to throw my 2 cents in and say that having a rotation and scale option in drawTiles() would be a fantastic feature.  Currently I've also been using Bitmap objects where rotation was important and drawTiles for everything else.
>>>
>>>
>>>
>>> On Fri, Oct 14, 2011 at 2:14 PM, Missile Mike <[hidden email]> wrote:
>>>>
>>>> Just getting back to reading this now....  Good job, Alex, and your
>>>> conclusion is the same as mine- drawTriangles is the best current method.
>>>> It also supports vertex coloring and alpha, in addition to being able to
>>>> scale and rotate.  So yeah, using a sprite sheet with all your images
>>>> crammed on there, and then using drawTriangles is the way to go.  Also, you
>>>> need to be careful about how many times you call BeginBitmapFill, because
>>>> it's a performance hit on iOS for each time it's called.
>>>>
>>>> Hugh:  If these were all added to drawtiles(), it would make things a lot
>>>> easier.
>>>>
>>>> --
>>>> View this message in context: http://haxe.1354130.n2.nabble.com/NME-rotation-best-practices-tp6880337p6894074.html
>>>> Sent from the Haxe mailing list archive at Nabble.com.
>>>>
>>>> --
>>>> haXe - an open source web programming language
>>>> http://haxe.org
>>>
>>>
>>>
>>>
>>
>>
>> --
>> haXe - an open source web programming language
>> http://haxe.org
>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org

--
haXe - an open source web programming language
http://haxe.org
12