Do bufferSubData to update.

 
Fordham: You have vectors and stuff.

Fordham: And its fast enough for me.

Sesser: I have a contract coming up for something a bit more involved than just a Game Boy, but it’s a great system to figure out the basic architecture I’ll use

Prosienski: Jkoudys, don’t ask me, tcsc is the expert on this

Ornelaz: Lol, i’ve only used pixi a bit, and dont know many resources for it. i usually write my own code for 2d stuff since it’s usually hobby stuff, 3d is what i do at work

Stockbridge: Tcsc, anything on github doing tile rendering?

Beales: Are you a 3d graphics programmer? cool

Fordham: Tcsc: what are you busy with generally?

Navaretta: MDN doesn’t do an awesome job with webgl yet, unfortunately

Ornelaz: Jkoudys: what do you mean, like a tile map?

Fordham: Do you code more or design more tcsc?

Ornelaz: Or do you mean like https://en.wikipedia.org/wiki/Tiled_rendering

Ornelaz: Fordham: exclusively code.

Thrush: Tcsc, basic tilemap. Think like an old nintendo

Ornelaz: Not really good ones though, but i’ve been looking for other work so hopefully that will change soon

Ornelaz: Jkoudys: okay that’s actually very easy

Ornelaz: Hm, i’m not sure the best way to do it with pixi is though

Salimi: I’m setup using a 2d context and creating an ImageData for each tile right now, so I’m hoping it’s an easy transition

Kue: Ideally no 3rd-party libs

Ornelaz: Oh dear thats going to be expensive

Crowl: My approach has been a huge improvement on the reference app though, which does direct pixel-by-pixel scanlines in order to simulate the original hardware

Simard: What do you mean by bad games? I’m pretty into indies, i get drawn by th art style, but I prefer 2d, since doing 3d right is very difficult

Ornelaz: You basically want to find the min bound for the camera, and the max bound for the camera, and just loop over every tile that’s in that region

Milroy: Why are you saying “camera”?

Ornelaz: Bfig: educational games, actually. but lately our quality has taken a big hit tbh.

Mugford: Very difficult in the sense that it is expensive as hell to build a well populated world of ***ets

Ornelaz: It’s just the term you use

Queeley: Jkoudys: the current view of your game world

Trobridge: Tcsc: what kind of games do you like?

Ornelaz: Jkoudys: is your tile map data static?

Ornelaz: If it is and not so huge, then you could just draw it once onto an offscreen canvas

Ornelaz: And draw that where you need to

Craze: Tcsc, pretty small – just 0x200

Delgatto: Not static, though it’s not updated super-often though it can be

Ornelaz: So, basically you’d make a canvas, and draw the whole map onto that

Marascalco: So 14480 pixels total

Bieker: Tcsc, ooh that’ll be handy – I can just throw the whole tilemap up easily then if you’re in debug mode

Ornelaz: Lets call it tileCanvas. and then when you need to render, you do screenContext.drawImagetileCanvas, -Math.roundminCameraXBound, -Math.roundminCameraYBound

Ornelaz: Or something along those lines

Ornelaz: Yeah 512×512 isnt a big deal. i’d avoid anything bigger than 2048×2048 probably

Ornelaz: Well, actually if its 8×8 tiles

Seder: Tcsc, how is this webgl though? It doesn’t sound much different than what I’m doing now

Ornelaz: Do you want the webgl solution?

Ornelaz: Thats closer to what i said before

Vories: Okay.needs more basic setup i guess

Ornelaz: You loop over the visible tiles

Ornelaz: Write them into a vertex buffer

Ornelaz: Do bufferSubData to update that buffer