These are chat archives for pixijs/pixi.js

5th
Feb 2016
Micheal Winger
@mordof
Feb 05 2016 02:11 UTC
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 UTC
what exactly your problem with the mesh? Can you show me?
Micheal Winger
@mordof
Feb 05 2016 13:33 UTC
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 UTC
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 UTC
its ok to duplicate vertices
also indices for quads can be pre-made with quad tools
Micheal Winger
@mordof
Feb 05 2016 13:39 UTC
ah - so everything in a mesh has to be triangles?
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:39 UTC
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 UTC
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 UTC
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 UTC
this.indices = indices || new Uint16Array([0, 1, 2, 3]);
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:41 UTC
that's for TRIANGLE_STRIP
in case you wanna make one polygon
yeah
Micheal Winger
@mordof
Feb 05 2016 13:42 UTC
is that different from TRIANGLE_MESH?
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:42 UTC
that's not obvious..
yeah :)
Micheal Winger
@mordof
Feb 05 2016 13:42 UTC
TRIANGLE_STRIP is nowhere in the documentation
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:42 UTC
so there are two options for you
Micheal Winger
@mordof
Feb 05 2016 13:42 UTC
and it defaults to using mesh
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:42 UTC
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 UTC
it's the index pointers to the vertices right?
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:43 UTC
yep
Micheal Winger
@mordof
Feb 05 2016 13:43 UTC
the vertex array*
thought so
tells the gpu how to order them i guess?
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:44 UTC
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 UTC
nods
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:45 UTC
that's because your quads arent actually on plane :)))
height of center must be average height of corners or something like that
Micheal Winger
@mordof
Feb 05 2016 13:46 UTC
right
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:46 UTC
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 UTC
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 UTC
we need more builder classes for meshes :)))
Micheal Winger
@mordof
Feb 05 2016 13:47 UTC
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 UTC
you mean that you store heights in one big 2d array?
Micheal Winger
@mordof
Feb 05 2016 13:47 UTC
each tile had it's own 4-item array
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:47 UTC
and some cells are centers, and others are corners?
Micheal Winger
@mordof
Feb 05 2016 13:47 UTC
but now, yes
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:47 UTC
yeah , thats good
Micheal Winger
@mordof
Feb 05 2016 13:48 UTC
giant 2d array
lol
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:48 UTC
we can use your stuff as open-source isometry library later
Micheal Winger
@mordof
Feb 05 2016 13:48 UTC
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 UTC
since https://github.com/Ezelia/ has only proprietary stuff for izometry :(
yep :)(
Micheal Winger
@mordof
Feb 05 2016 13:48 UTC
ooh
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:49 UTC
You're growing up, my padawan! :)
Micheal Winger
@mordof
Feb 05 2016 13:50 UTC
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 UTC
open-sourced library can be ctrl+c ctrl+v of general stuff you wrote
that we already discussed :)
Micheal Winger
@mordof
Feb 05 2016 13:50 UTC
yep
true
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:51 UTC
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 UTC
will that replace what i've been working on?
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:53 UTC
it'll give more freedom about coordinates
Micheal Winger
@mordof
Feb 05 2016 13:53 UTC
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 UTC
we'll turn it into library together and you'll be official contributor :)
I'll wait when your stuff will be ready enough
Micheal Winger
@mordof
Feb 05 2016 13:54 UTC
sounds good :)
Ivan Popelyshev
@ivanpopelyshev
Feb 05 2016 13:54 UTC
you're not alone in making isometric engine, and if we make it open-source, you'll have free patches from other people as dividents :)
Micheal Winger
@mordof
Feb 05 2016 13:55 UTC
well - provided it's good enough for other people to actually use
but i think, because of the amount of help/guidance you've provided, that it likely will be