Switch to DuckDuckGo Search
   September 1, 2012  
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | >


NOTICE: This channel is no longer actively logged.

Toggle Join/Part | bottom
[00:11:25] *** xbelanch has quit IRC
[00:15:10] <Decept404> haha man
[00:15:13] <Decept404> fixed our flash build
[00:15:17] <Decept404> wall to wall drawTiles
[00:15:21] <Decept404> does not work at alll haha
[00:32:25] <Decept404> i really wish the Tilesheet had public accessors for the rectangles list
[00:48:13] *** andrew-andrew has quit IRC
[00:49:05] *** justinfrontThink has quit IRC
[01:25:04] *** corne is now known as corne_away
[01:41:29] *** justsee has joined #nme
[01:58:33] *** justsee has quit IRC
[02:26:38] <Decept404> hey singmajesty
[02:27:28] <Decept404> if i want to set the --no-traces flag in the nmml
[02:27:30] <Decept404> where would i do that?
[02:29:00] <Jan_Flanders> http://code.google.com/p/nekonme/source/browse/trunk/tools/command-line/spec.nmml#363
[02:29:27] <Decept404> ah haxeFLAG
[02:29:34] <Decept404> i thought haxedef would be it
[02:29:51] <Decept404> well jeez haha
[02:29:54] <Decept404> no wonder it didn't' work for me
[02:29:55] <Jan_Flanders> def is for -D
[02:30:24] *** justsee has joined #nme
[02:41:12] *** Caribou__ has quit IRC
[02:46:58] *** justinfrontThink has joined #nme
[02:52:08] <justinfrontThink> Decept404 your talking in Brighton?
[02:56:58] <justinfrontThink> I have some tilesheet code but I don't expect it's very optimal.
[02:59:13] <Decept404> yeah i don't think there is a good optimal way to do it
[02:59:20] <Decept404> i wrote a drawTiles renderer that supports scale/rotation
[02:59:33] <Decept404> but it needs a temp bitmapdata for every drawn sprite
[02:59:41] <Decept404> stupid bitmapdata.draw, what a weird design
[03:00:23] <justinfrontThink> oh mine was done for jeash quite awhile ago
[03:02:15] <justinfrontThink> looks like i used copyPixels... since then I have used the bitmap.draw on that jigsaw thing, I don't know which is faster
[03:02:53] <justinfrontThink> wait you can use a matrix in the draw code?
[03:02:56] *** singmajesty has quit IRC
[03:04:10] <justinfrontThink> I was doing something like... surfaces[ count ].bitmapData.draw( spCloth, new Matrix( 1.2, 0, 0, 1.2, -xy.x - off.x, -xy.y - off.y) );
[03:05:40] <Decept404> yeah but the clip rect is post draw :/
[03:05:43] <Decept404> so all rotation/scale looks wrong
[03:05:58] <Decept404> i copy the pixels to a temp buffer
[03:06:02] <Decept404> then draw that buffer with a matrix
[03:08:12] <justinfrontThink> what do you mean all the rotation/scale looks wrong?
[03:09:35] <Decept404> well the clip rect isnt transformed
[03:09:36] <Decept404> or rotated
[03:09:48] <Decept404> and the image being clipped is the post transform result
[03:09:57] <Decept404> so if you set your rect to match the tilesheet, draw it with a transform
[03:10:14] <Decept404> the final rectangle copied to the render is still not rotated
[03:11:02] <Decept404> in other news, building for android with --no-trace breaks
[03:11:23] <Decept404> like 352 of neash.display.Stage.hx
[03:11:26] <justinfrontThink> when playing with physaxe I rotated tiles with beginBitmapFill
[03:12:11] *** singmajesty has joined #nme
[03:12:11] *** ChanServ sets mode: +o singmajesty
[03:13:07] <Decept404> our entire game is drawn with drawTiles, so it was a pretty easy switch for me to go to a bitmap renderer on flash
[03:13:35] <singmajesty> Do you think there should be a Stage3D drawTiles?
[03:13:39] <singmajesty> Just for the Flash target?
[03:13:49] <Decept404> i think that would be a very popular decision
[03:14:03] <singmajesty> I personally hesitate to use drawTiles
[03:14:04] <Decept404> then again, you do lose some flexibility
[03:14:14] <singmajesty> The idea of only using images from a single bitmapdata scares me
[03:14:26] <singmajesty> Just that idea of limitation, though I know its how the GPU works :)
[03:14:34] <Decept404> it's worked pretty good for us, but it did take some getting used to
[03:14:41] <singmajesty> Do you find you can call drawTiles multiple times per frame, with good results?
[03:14:49] <singmajesty> Or do you mostly have to do it all in one call?
[03:15:00] <Decept404> we have one call per texture we draw from, naturally
[03:15:09] <Decept404> and we have 2-3 textures and some bitmap fonts as well
[03:15:15] <singmajesty> Right, but per frame?
[03:15:18] <Decept404> i think we do around 5-6 draw calls a frame
[03:15:23] <singmajesty> Okay
[03:15:29] <Decept404> i should probably log this ;)
[03:15:31] <singmajesty> And that's much better performance than the display list?
[03:16:07] <Decept404> our game has run very well almost the entire time
[03:16:11] <Decept404> but we shifted to drawtiles quite early
[03:16:13] <justinfrontThink> with flash if you draw them all to a single bitmap it's faster
[03:16:18] <Decept404> i couldnt tell you the biggest difference
[03:16:27] <Decept404> i just know we keep throwing stuff at it and it never breaks
[03:16:41] <Decept404> another thing is, i assume the display list, with inherited transforms, involves a lot of matrix multiplications
[03:16:56] <singmajesty> Hmm, that might be possible
[03:17:04] <Decept404> i dunno if i'd feel comfy throwing the amount of sprites around that we do using the list
[03:17:19] <singmajesty> If you end up with multiple renderers, for sake of Flash...
[03:17:35] <singmajesty> It would be very interesting to know the difference in performance between drawTiles, versus multiple Bitmap objects
[03:17:45] <singmajesty> And how many times you use drawTiles
[03:17:53] <justinfrontThink> sorry what does drawTiles do?
[03:18:01] <singmajesty> The more times I can use the call per frame, the less the idea scares me :)
[03:18:16] <singmajesty> Because I worry not only about getting enough textures, but also z-indexing
[03:18:26] <singmajesty> It's like drawTriangles, but with squares
[03:18:31] <singmajesty> It's a single batch draw operation
[03:18:36] <Decept404> we didnt really have a working flash build until about an hour ago
[03:18:38] <singmajesty> So you can do something like BunnyMark all in one call
[03:18:44] <singmajesty> Works well with the GPU
[03:18:45] <Decept404> well our renderer treats it like painter's algorithm
[03:18:52] <Decept404> so stuff that wants to be drawn adds itself to a list
[03:19:02] <Decept404> and we iterate from the root up, like a tree. its a lot like the display list really
[03:19:13] <Decept404> so the order of draw calls ends up being z-sorted regardless
[03:19:18] <singmajesty> But you're able to automatically combine objects that come from the same texture?
[03:19:21] <singmajesty> To minimize calls?
[03:19:30] <singmajesty> That's kind of what I'm wondering
[03:19:31] <Decept404> yeah we have batchers and groups of batchers
[03:19:36] <singmajesty> Because if there's a significant benefit...
[03:19:40] <Decept404> so you create a group and point it to a texture
[03:19:43] <justinfrontThink> You should probably find the way the 3d engines do it is the best way in flash
[03:19:46] <singmajesty> Even without hyper-optimizing to one or two calls...
[03:19:52] <Decept404> and then create groups of objects under that group again and so forth
[03:19:54] <singmajesty> Then it would be good to provide an automated way to do that
[03:20:02] <Decept404> and when you call render on the group, it gathers the tile info from its children and children's children
[03:20:19] <Decept404> so it boils down to a single drawtiles at the end, with hundreds of objects drawn
[03:20:50] <Decept404> well the way i wrote it was to say ok, any child object added to this group loses authority over what texture it is drawn from
[03:21:08] <singmajesty> Oh, so you batch on the fly?
[03:21:09] <justinfrontThink> The sandy code runs in nme, it should be fairly good at that sort of approach if your hitting android?
[03:21:10] <Decept404> and also the authority to decide how it should draw that texture, beyond the basic transform (x,y,scale,rotation)
[03:21:19] <Decept404> yeah
[03:21:24] <singmajesty> That's nice
[03:21:41] <singmajesty> BTW, I've never tried --no-trace before
[03:21:46] <Decept404> we start every frame with an empty list, fill it with "draw instructions", and at the end of the frame send that list to a renderer that draws it first-to-last
[03:21:46] <singmajesty> But that also works now from the command-line
[03:21:49] <singmajesty> nme test flash --no-trace
[03:22:00] <Decept404> try android
[03:22:11] <Decept404> #if android
[03:22:11] <Decept404> @:functionCode("try {")
[03:22:11] <Decept404> @:functionTailCode(' } catch(Dynamic e) { __hx_dump_stack(); ::haxe::Log_obj::trace(HX_CSTRING("Uncaught exception: ") + e,hx::SourceInfo(HX_CSTRING("Stage.hx"),0,HX_CSTRING("nme.display.Stage"),HX_CSTRING("nmeDoProcessStageEvent")));}')
[03:22:12] <Decept404> #end
[03:22:14] <singmajesty> Do you discard your render arrays on each frame?
[03:22:17] <singmajesty> Or do you cache it?
[03:22:18] <Decept404> i think no-trace removes haxe::Log_obj
[03:22:41] <Decept404> i changed it to #if (android && debug) and called it a day ;P
[03:22:49] <singmajesty> ;)
[03:22:50] <Decept404> we discard our arrays, yeah
[03:23:11] <singmajesty> Yeah, it sounds like you're using drawTiles fairly liberally
[03:23:16] <justinfrontThink> in html5 you should only redraw parts that have changed that is super important but hard
[03:23:23] <singmajesty> Rather than the hardcore way I expected it had to be used for good performance
[03:23:31] <Decept404> i'm not sure it's the best solution, but i wanted to be able to just removechild an object and not have it need to unsubscribe from anything
[03:23:44] <singmajesty> If you have the ability to test your renderer using separate Bitmap instances, and moving those around, rather than drawTiles, I'd love to hear the performance difference
[03:23:48] <Decept404> so every frame i crawl the tree and update the game objects, and return a list of visible stuff to be drawn
[03:24:06] <singmajesty> If there's a significant difference, then I think we should provide APIs so developers can do that
[03:24:39] <Decept404> it wouldn't be trivial to do so right now :)
[03:24:58] <Decept404> there's little we draw that isn't done with drawtiles, including text
[03:27:17] <Decept404> we do use drawTriangles in some instances
[03:27:23] <Decept404> for backgrounds specifically
[03:30:14] <singmajesty> What are you using for Flash?
[03:30:19] <singmajesty> Are you using drawTiles still?
[03:30:27] <Decept404> i wrote my own renderer for drawTiles
[03:30:36] <Decept404> and changed Tilesheet to give me access to the offset/rectangle arrays
[03:31:23] <singmajesty> So you still use drawTiles on Flash, but with copyPixels instead of drawRect/drawTriangles?
[03:31:27] <Decept404> yeah
[03:31:29] <Decept404> http://pastebin.sekati.com/?id=Anonymous@c6323-c0df6a1d-t
[03:31:35] <Decept404> we don't use rgb/alpha ever for drawtiles btw
[03:31:40] <Decept404> only scale/rotation
[03:31:51] <Decept404> havent had a use for either tinting or alpha yet
[03:32:41] <singmajesty> I'm open to improving Tilesheet in NME, proper
[03:32:57] <Decept404> for one i'd love a pointer to the texture it's using
[03:32:58] <singmajesty> And if the Flash version of drawTiles doesn't perform, a copyPixels approach is totally alright
[03:32:59] <justinfrontThink> Guys I wanted to ask is the way I do the jigsaw drawing bad? http://pastebin.com/mBnV79kD
[03:33:17] <Decept404> i'm using a static manager with a typeddictionary to look up textures by their tilesheets right now
[03:33:20] <Decept404> which feels unwieldy
[03:35:10] <Decept404> you guys seem way more comfy with type inference than me
[03:36:19] *** photex has quit IRC
[03:37:25] <justinfrontThink> I have some classes for tilesheet but uses array...
[03:41:05] <justinfrontThink> http://pastebin.com/KQUxzFtF no idea if it was a good approach something I played with in jeash just before first haxe meeting recently tried it an android.
[03:41:42] <justinfrontThink> I think I should probably change it to draw to a single bitmap like your talking about
[03:44:12] <justinfrontThink> in physaxe I got my changed render code work from a long time back working with nme http://pastebin.com/Q3Uh4qLC
[03:44:21] <justinfrontThink> and it's different again.
[03:46:00] <justinfrontThink> singmajesty is the drawTile stuff NME specific code sorry I get a bit lost I work out fast code in as3 and haxe at different times and loose track of what is the best approach, it seems to change.
[03:46:28] <singmajesty> Wait...
[03:46:39] <singmajesty> Decept404: Wouldn't you save the tile ID with each game object?
[03:46:43] <singmajesty> Then reuse that in the future?
[03:47:06] <singmajesty> justinfrontThink: drawTiles is one of few NME-specific APIs
[03:47:20] <singmajesty> Hugh added it to provide a fastest rendering path
[03:48:19] <justinfrontThink> Oh ok it is best approach on android and flash target?
[03:49:30] <justinfrontThink> I used Keith's tool for getting bitmaps I had some code of mine but his was all packaged into a AIR thing, it was before Hugh had made his thing I think.
[03:49:54] <justinfrontThink> Hugh thing cuts up the png for you?
[03:50:13] <justinfrontThink> I will take a look on haxenme
[03:51:45] <singmajesty> This is the order, from slowest to fastest, on Flash (roughly)
[03:52:09] <singmajesty> drawTriangles < display list < drawRect < copyPixels
[03:52:18] <singmajesty> This is the order, from slowest to fastest, on NME (roughly)
[03:52:27] <justinfrontThink> what about draw
[03:52:31] <singmajesty> copyPixels < drawRect < display list < drawTriangles < drawTiles
[03:52:33] *** justsee has quit IRC
[03:52:39] <singmajesty> So it is roughly opposite of Flash
[03:52:55] <justinfrontThink> bitmapdata.draw ?
[03:53:08] <singmajesty> That's slow on most platforms
[03:53:25] <singmajesty> And that's a way of capturing something you've already rendered
[03:53:34] <singmajesty> These area all ways of "getting pixels out"
[03:54:08] <singmajesty> Though you can use BitmapData.draw in combination with these other methods
[03:54:23] <singmajesty> For example, use bitmapData.draw to bake down a complex scene into one bitmap
[03:54:26] <singmajesty> then use it on the display list
[03:54:32] <justinfrontThink> ok one thing I found was fast was to swap bitmapdata's on a bitmap on a sprite is that what you mean by display list?
[03:54:33] <singmajesty> Or copyPixels, or drawTiles, etc.
[03:54:43] <singmajesty> Yep, that would still be display list
[03:54:52] <singmajesty> Yes, that's one of the fastest ways to render on Flash, if not the fastest
[03:54:58] *** Decept404 has quit IRC
[03:55:03] <singmajesty> That's why I say roughly --
[03:55:11] <justinfrontThink> but not so good on android?
[03:55:13] <singmajesty> Most will argue that copyPixels is always fastest on Flash
[03:55:38] <singmajesty> But I believe that careful use of the display list, swapping bitmap data and simplifying objects with bitmapData.draw, can run faster
[03:55:44] <singmajesty> And much easier to maintain
[03:55:46] <singmajesty> Umm..
[03:55:51] <singmajesty> Main problem with that approach is memory
[03:55:55] <singmajesty> It ends up eating more memory
[03:56:04] <singmajesty> Which isn't as much a problem on Flash or some platforms
[03:56:12] <singmajesty> Bad on iOS because Apple is very stingy on memory
[03:56:15] <singmajesty> very
[03:56:20] <singmajesty> stingy
[03:57:30] <justinfrontThink> But apple you need mountain lion now just to publish?
[03:57:52] <singmajesty> I'm not sure
[03:57:56] <singmajesty> Did they change something there?
[03:59:28] <justinfrontThink> It would be nice to have a apple render machine online like you said.
[03:59:45] <justinfrontThink> on list
[04:01:34] *** justsee has joined #nme
[04:03:34] <singmajesty> Agreed :)
[04:04:00] <singmajesty> ...or for Apple to accommodate developers more ;)
[04:04:09] <justinfrontThink> I wondered if work Hugh does would work with Sandy engine because I guess sandy could be extended to do AWD2 format and improved, it's just a beginning to have a low level 3d render stuff you still need collada parsers etc... so you can get the workflow from 3d package to say prefab to say the stuff on nme, or is Hugh looking at a more extensive c++ engine with some of this already?
[04:04:33] <singmajesty> As far 3D goes...
[04:04:48] <singmajesty> I expect we will expose more of the OpenGL API through the existing display list or graphics objects we have
[04:05:05] <singmajesty> We will not use a completely separate 3D API, like Stage3D
[04:05:24] <singmajesty> Once this is in place, it will mean it should be rather simple to mix and match 2D and 3D content if you are targeting native
[04:05:40] <singmajesty> However, we might provide a Stage3D compatible library on haxelib, if you want to use Haxe and NME the same way
[04:05:53] <justinfrontThink> So we should really see how it can fit with Sandy... because that seems to works on NME at the moment although not tried much
[04:05:54] <singmajesty> Or then we could look at bridging support with other libraries, like Away3D, etc.
[04:06:09] <singmajesty> Perhaps using the Stage3D compatibility library
[04:06:24] <singmajesty> But the key is that NME is already 3D, so we're exposing 3D throughout, rather than putting it in its own silo
[04:06:34] <singmajesty> But the first step is to have shader support
[04:06:36] <justinfrontThink> The work needed to get away on nme is a lot as sandy is there it maybe better to adapt it.
[04:06:46] <singmajesty> Perhaps
[04:07:02] <singmajesty> But in my experience (yours may be different), 3D libraries are also a lot like physics libraries...
[04:07:19] <singmajesty> In that you can get really stuck if the library you use implements all but one essential feature...
[04:07:24] <singmajesty> And you may be hopelessly stuck
[04:07:33] <singmajesty> Since 3D/Physics math can be boggling ;)
[04:07:46] <singmajesty> Then you end up backing out, finding another library, and rewriting it all
[04:08:23] <singmajesty> I had that problem using APE, then moving to Box2D
[04:08:28] <justinfrontThink> Sandy needs BSP and AWD2 format... not sure it has them, but it has some physics I have not tried that Niel ported
[04:08:34] <singmajesty> Also had that problem with 3D rendering software
[04:08:55] <justinfrontThink> Is Nape best 3d engine for haxe at moment?
[04:09:34] <justinfrontThink> For banners APE is simple and can be cut down so it can be useful when filesizes are an issue.
[04:10:24] <justinfrontThink> Not yet used physics engines much but code my own physics simple stuff :)
[04:11:18] <justinfrontThink> Its sometimes easier to control code if it is simple hand physics rather than an engine
[04:12:19] <justinfrontThink> would shader support be good for rotated textfields?
[04:22:25] *** Jan_Flanders has quit IRC
[04:23:00] <singmajesty> Nape is supposed to be good
[04:23:04] <singmajesty> But I hear its slow on mobile
[04:23:12] <singmajesty> So it may be too reliant on the CPU?
[04:23:19] <singmajesty> Or that might be an issue of memory management
[04:23:27] <singmajesty> API is still good for simple physics
[04:23:38] <singmajesty> It was defining my own body shapes, etc, that ran me into trouble
[04:23:46] <singmajesty> I think my haxelib of APE should work
[04:23:55] <singmajesty> Shader support might help with rotated textfields
[04:24:02] <singmajesty> Though I think that a smooth bitmap should already help?
[04:24:13] <singmajesty> The TextField class just needs some love :(
[04:25:19] <justinfrontThink> oh you port API cool that means I can probably run some as3 stuff as tests
[04:25:29] <singmajesty> You can try it
[04:25:33] <singmajesty> I believe it is "ape" on haxelib
[04:25:42] <singmajesty> If there's an error in it, feel free to let me know so I can fix it
[04:25:59] <singmajesty> Or submit a pull request: https://github.com/jgranick/ape
[04:26:23] <justinfrontThink> did you try flinthx it will not compile on android and dies after awhile of rendering on windows
[04:27:23] <justinfrontThink> I think everyone is using Nape, but it's great to make tests with some old projects you get a compartive feel
[04:27:46] <justinfrontThink> Does ape run faster than nape ?
[04:28:26] <justinfrontThink> I think flinthx is phillippe's lib ported from richard lords amazing work
[04:30:32] <justinfrontThink> By the way do you think textmate2 now opensource would be good to adapt for NME on osx platform?
[04:39:56] *** photex has joined #nme
[04:40:04] <singmajesty> I thought everyone used Box2D :)
[04:40:15] <singmajesty> I have been using MonoDevelop
[04:40:26] <singmajesty> I had looked at TextMate and Sublime Text before, and neither felt comfortable
[04:40:34] <singmajesty> Perhaps TextMate 2 would feel different
[04:40:58] <singmajesty> I do like that MonoDevelop is cross-platform, so it can work on Windows, Mac and Linux, but that's not necessarily the first requirement of an ediro
[04:41:00] <singmajesty> editor
[04:48:57] <justinfrontThink> textmate takes time to get used to but it's very special once you do there are a few haxe users that really love it. Monodevelop is a very large download... it seems a bit too much in the eclipse style of heavy editor, although similar to flashdevelop
[04:50:20] <justinfrontThink> e-texteditor is similar to textmate and linux version has been open for awhile but very broken, it works on pc/linux and probably on mac I think it was not allowed on mac as an agreement but that may have changed now.
[05:12:39] *** singmajesty has quit IRC
[05:35:13] *** justsee has quit IRC
[07:47:53] *** greg_dove has quit IRC
[08:12:08] *** photex has quit IRC
[08:13:25] *** photex has joined #nme
[08:24:01] *** justinfrontThink has quit IRC
[08:24:25] *** justinfrontThink has joined #nme
[09:10:40] *** justinfrontThink has quit IRC
[10:04:28] *** nevdull has joined #nme
[11:04:13] *** justsee has joined #nme
[11:47:13] *** justsee has quit IRC
[13:22:14] *** Jan_Flanders has joined #nme
[14:20:11] *** nevdull has quit IRC
[15:02:05] *** ChanServ has quit IRC
[15:06:58] *** ChanServ has joined #nme
[15:06:58] *** rajaniemi.freenode.net sets mode: +o ChanServ
[16:53:33] *** justsee has joined #nme
[17:54:48] *** Yrgkala has joined #nme
[18:58:59] *** Yrgkala_ has joined #nme
[18:58:59] *** Yrgkala has quit IRC
[20:34:20] *** photex has quit IRC
[20:35:52] *** photex has joined #nme
[20:44:16] *** xbelanch has joined #nme
[20:52:12] *** Decept404 has joined #nme
[20:52:14] <Decept404> hi all
[21:04:57] <Jan_Flanders> hey
[22:48:54] *** Caribou| has joined #nme
[23:52:33] *** justsee has joined #nme
top

   September 1, 2012  
< | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | >