These are chat archives for pixijs/pixi.js

5th
Feb 2016
Micheal Winger
@mordof
Feb 05 2016 02:11
gonna avoid the mesh for now
i can do chunk loading with the way i'm doing things currently without a drop in fps - and it still allows me for more malleability of the land
will separate out the map rendering as much as i can though in the event that it may need to be changed over later
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 10:15
what exactly your problem with the mesh? Can you show me?
Micheal Winger
@mordof
Feb 05 2016 13:33
i wasn't getting the indices mapped properly. also, the fact that i'll have to duplicate each vertex kinda sucks and there's no way to avoid that, since uv mapping doesn't allow for a single vertex to point to different locations
unfortunately i don't have anything to show for it anymore - i tossed it.
Micheal Winger
@mordof
Feb 05 2016 13:38
i'm considering it a premature optimization for the time being - since my current method works smoothly, and is actually easier to work with
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:38
its ok to duplicate vertices
Micheal Winger
@mordof
Feb 05 2016 13:39
ah - so everything in a mesh has to be triangles?
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:39
yep
but indices for quads can be pre-made for all meshes at once, they are easy
6 indices per quad (2 triangles)
Micheal Winger
@mordof
Feb 05 2016 13:40
see - based on the source for Mesh, that's not obvious
because it uses 4 vertices, and 4 indices.. and it makes a square
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:41
also you can ignore indices completely, just use vertices
no, it uses 4 vertices and 6 indices
look closer :)
Micheal Winger
@mordof
Feb 05 2016 13:41
this.indices = indices || new Uint16Array([0, 1, 2, 3]);
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:41
that's for TRIANGLE_STRIP
in case you wanna make one polygon
yeah
Micheal Winger
@mordof
Feb 05 2016 13:42
is that different from TRIANGLE_MESH?
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:42
that's not obvious..
yeah :)
Micheal Winger
@mordof
Feb 05 2016 13:42
TRIANGLE_STRIP is nowhere in the documentation
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:42
so there are two options for you
Micheal Winger
@mordof
Feb 05 2016 13:42
and it defaults to using mesh
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:42
1) pre-generate indices for a bunch of quads
(0,1,2) (2,3,0), (4,5,6), (6,7,4) and so on
that array doesnt depend on your coords
and I think you can find it somewhere in pixi
Micheal Winger
@mordof
Feb 05 2016 13:43
it's the index pointers to the vertices right?
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:43
yep
Micheal Winger
@mordof
Feb 05 2016 13:43
the vertex array*
thought so
tells the gpu how to order them i guess?
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:44
if you use that array, you'll be able put quads of vertices and dont care about triangels
yep
but in your case I think you need to use 15 indices per tile
(0,1,2),(0,2,3),(0,3,4),(0,4,1)
center, left,up,right,down
5 vertices
Micheal Winger
@mordof
Feb 05 2016 13:45
nods
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:45
height of center must be average height of corners or something like that
Micheal Winger
@mordof
Feb 05 2016 13:46
right
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:46
if you post an example somewhere: in codepen or somewhere else, i can help you to set the mesh code right
I'll need that code for other examples anyway
Micheal Winger
@mordof
Feb 05 2016 13:46
yeah - that part is already in place now. i stopped using my crazy way of keeping track of each left up right down solely for each tile, and converted to using the map data
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:47
we need more builder classes for meshes :)))
Micheal Winger
@mordof
Feb 05 2016 13:47
so now i have all the data in place easier for making a mesh if i choose to tackle it later
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:47
you mean that you store heights in one big 2d array?
Micheal Winger
@mordof
Feb 05 2016 13:47
each tile had it's own 4-item array
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:47
and some cells are centers, and others are corners?
Micheal Winger
@mordof
Feb 05 2016 13:47
but now, yes
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:47
yeah , thats good
Micheal Winger
@mordof
Feb 05 2016 13:48
giant 2d array
lol
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:48
we can use your stuff as open-source isometry library later
Micheal Winger
@mordof
Feb 05 2016 13:48
the other way is problematic for resolving height changes
(the individual 4-item array was problematic i mean)
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:48
since https://github.com/Ezelia/ has only proprietary stuff for izometry :(
yep :)(
Micheal Winger
@mordof
Feb 05 2016 13:48
ooh
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:49
You're growing up, my padawan! :)
Micheal Winger
@mordof
Feb 05 2016 13:50
not entirely sure what i'm going to do with this project yet, but i'll keep the possibility of open sourcing it in mind
heh, thanks
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:50
open-sourced library can be ctrl+c ctrl+v of general stuff you wrote
Micheal Winger
@mordof
Feb 05 2016 13:50
yep
true
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:51
I know how to do that anyway, but I need some base to make a library :)
Also pixi v4 will haev 2.5D soon
im working on that
and some of your stuff must be relevant for that
Micheal Winger
@mordof
Feb 05 2016 13:52
will that replace what i've been working on?
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:53
it'll give more freedom about coordinates
Micheal Winger
@mordof
Feb 05 2016 13:53
either way - i haven't contributed much to open source, and i'd like to.. so yeah, once i get this resolved (i think that'll be quite soon, it seems to be almost done). i'll ask your help to how best turn it into a library for open source use
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:53
we'll turn it into library together and you'll be official contributor :)