These are chat archives for pixijs/pixi.js

4th
Jul 2018
Mark Knol
@markknol
Jul 04 2018 14:51
@ivanpopelyshev Hi, is this a known issue ; Im using several TilingSprites but it seems to cause rendering hickups? (pixi 4.7.0)
when I switch to normal Sprites there are no hickups
Ivan Popelyshev
@ivanpopelyshev
Jul 04 2018 14:56
no, its not
Mark Knol
@markknol
Jul 04 2018 15:04
any idea why/what could cause this? It seems mostly hickup which is related to some videocards
Ivan Popelyshev
@ivanpopelyshev
Jul 04 2018 15:05
i have no idea :)
Mark Knol
@markknol
Jul 04 2018 15:06
that's a pity, will try to work around it for now
Ivan Popelyshev
@ivanpopelyshev
Jul 04 2018 15:06
i mean, i know exactly how TilingSprite works and how SpriteRenderer works. I rewrote TilingSprite for pixi
it really should not affect performance
where do you use it?
Mark Knol
@markknol
Jul 04 2018 15:07
what do exactly you mean with where do you use it?
in a game
Ivan Popelyshev
@ivanpopelyshev
Jul 04 2018 15:07
in which part of game
Mark Knol
@markknol
Jul 04 2018 15:08
to create backgrounds. the case is we have repeating blocks. the background parts are moving (just using s.position.x/y) and we're not using the uv transforms or something
Ivan Popelyshev
@ivanpopelyshev
Jul 04 2018 15:10
what kind of a texture?
Mark Knol
@markknol
Jul 04 2018 15:10
the sprites arent crazy big, but do get scaled to fit to screen
Ivan Popelyshev
@ivanpopelyshev
Jul 04 2018 15:10
and how many backgrounds are there? is overdraw big?
Mark Knol
@markknol
Jul 04 2018 15:11
its using "framed" Textures, its using parts from texture atlas
we dont make much backgrounds, I think there are 4/5 concurrent backgrounds
not much overdraw, but we see it happening with just only those tilingsprites on screen
Ivan Popelyshev
@ivanpopelyshev
Jul 04 2018 15:16
well, shader is slower for those textures
optimal thing for TilingSprite is texture of pow2 size
otherwise, it switches to shader that might be slower
is it on mobile devices?
Mark Knol
@markknol
Jul 04 2018 15:18
the base textures are power of 2
Ivan Popelyshev
@ivanpopelyshev
Jul 04 2018 15:18
but its in atlas
Mark Knol
@markknol
Jul 04 2018 15:18
the atlas is power of 2
the backgrounds are random sizes
Ivan Popelyshev
@ivanpopelyshev
Jul 04 2018 15:19
the thing that's important is whether we have to use % operator
if texture is from atlas, we have to take texture frame into account
if its a single pow2 texture, then we use webgl REPEAT feature
Sprite solution might be better in that case
if you want, you can make a plugin that emulates TilingSprite through multiple sprites :)
and that'll be faster than original TilingSprite for backgrounds
Mark Knol
@markknol
Jul 04 2018 15:23
yeah was thinking about that too. but then we need a mask for half sized backgrounds
I mean if we have background of 150x150, and we want to tile it to size 200x200, we need 4 sprites, and mask them
Ivan Popelyshev
@ivanpopelyshev
Jul 04 2018 15:25
you dont have to mask them
clone the texture several times and change the frame
change frame, call _updateUvs(), that kind of stuff
actually rectangular masks are fast :)
use whatever works for you
Mark Knol
@markknol
Jul 04 2018 15:28
thanks for the pointers!
i think masks are the most straightforward