These are chat archives for pixijs/pixi.js

16th
Jul 2018
Mark Knol
@markknol
Jul 16 2018 09:44
@ivanpopelyshev I recently upgraded to pixi v4.8.1 but I get this error:
Uncaught TypeError: Cannot read property 'frame' of undefined
    at Function.registerFont (pixi.js:31653)
    at parse (pixi.js:37148)
    at completed (pixi.js:37091)
    at Loader.bitmapFontParser (pixi.js:37106)
    at pixi.js:5027
    at pixi.js:6257
it get it while loading the project, since that is loading bitmapfonts, where it seems to introduce this error
It (seems to) assume the font texture is loaded, do I have to load the png first ?
Mark Knol
@markknol
Jul 16 2018 10:26
weird thing is that the loader always seems to load the fnt file first so I have no control on this
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 12:12
my telepathy doesnt work on this case
please make a fiddle and post in issues.
(i mean, sometimes that info is enough, but not always)
Mark Knol
@markknol
Jul 16 2018 12:31
pixijs/pixi.js#5025
there you go
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 13:05
are you sure that you need to add png there?
hm, console is clear for me
completely clear
not even pixi in it
in debugger i see that texture exists
everything is fine
@markknol ideas?
Mark Knol
@markknol
Jul 16 2018 13:15
what exactly does "fine" mean? I get this error:
image.png
it does work.
check your browser extensions.
im on windows. maybe something wrong on mac?
Mark Knol
@markknol
Jul 16 2018 13:18
ah wait, it is related to adding the png file
you removed that, but it is added in my case
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 13:18
no, i works both with add of second file and not
you dont need it but that's not the cause
Mark Knol
@markknol
Jul 16 2018 13:19
I tried incognito (chrome, no extensions) and it fails
in firefox it just works
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 13:21
im on chrome 66 x64
Mark Knol
@markknol
Jul 16 2018 13:21
Im on chrome 67.0.3396.99
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 13:21
it also works on chrome 69
67.0.3396.99 , also works.
i dont know which advice to give you :)
i know the stupid one: check your antivirus web-screen
and check your computer on viruses
Mark Knol
@markknol
Jul 16 2018 13:25
I can reproduce it on multiple machines
my collegue has same issue
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 13:25
oh right.. i just reproduced it on your original fiddle
Ivan Vodopiviz
@ivodopiviz
Jul 16 2018 13:25
sup people, I'm playing an intro video using Texture.fromVideoUrl and chrome refuses to do it when it doesn't have the focus
is there any way to catch that exception? I'll just default to skipping the intro if we have problems
Mark Knol
@markknol
Jul 16 2018 13:27
it seems like a loading / timing related thing, for me it looks like sometimes the texture isnt there yet
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 13:29
for (const name in this.resources) { if (this.resources[name].url === url) { this.resources[name].metadata.pageFile = pageFile; completed(this.resources[name]); exists = true; break; } }
so it searches if the png was already added
and it has special logic in that case
but it doesnt have texture yet
its loading
done. now we know whats wrong with it
and you can just remove second add
Mark Knol
@markknol
Jul 16 2018 13:32
hm
okay
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 13:32
and somebody will have to patch BitmapFontLoader
good job :)
Mark Knol
@markknol
Jul 16 2018 13:33
:D
I have a setup (in Haxe) where I build a filename list from filesystem, so I can just say "load this directory", so it's kinda hard to remove the .add in my case, since this is automated
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 13:34
even better! now we know who will patch it!! BWAHAHAHAHA
check if "texture" exists in the resource, and if it doesnt, add an extra listener to loaded event of texture resource
then rebuild pixi, check if it actually goes in that if .
Mark Knol
@markknol
Jul 16 2018 13:35
you mean .. you are going to patch it? :p
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 13:46
...
i hate open-source.
working on it. pixijs/pixi.js#5027
Mark Knol
@markknol
Jul 16 2018 13:58
im not sure, cant test it properly
i placed breakpoint but it doesnt go there, for me that image is always loaded :(
Mark Knol
@markknol
Jul 16 2018 14:06
i still see it happening with the provide build
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 14:06
the problem is that i cant reproduce it => cant debug properly
Mark Knol
@markknol
Jul 16 2018 14:07
I mostly can reproduce when devtools are closed
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 14:07
yeah, when cache is not disabled
strange
Mark Knol
@markknol
Jul 16 2018 14:07
indeed
that makes it hard to capture indeed
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 14:07
i dont know how to manually trigger that thing
need to manually throttle that png
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 14:15
ok, rebuilding
there will be try
ok, i've reproduced it and now it works.
lets wait for a build
now go to https://www.patreon.com/user?u=2384552 or help me to pay for my servers :)
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 14:22
Mark Knol
@markknol
Jul 16 2018 14:33
jeee seems to be fixed!
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 14:33
well, you've found a problem , I figured out solution and it wasn't that easy
for other things, like Spine loader, it wont work
Mark Knol
@markknol
Jul 16 2018 14:34
any idea why didnt it fail in older versions?
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 14:34
i dont know history of that file, and i dont want to look at it
other people maintained it
Mark Knol
@markknol
Jul 16 2018 14:34
:)
Karol Stopyra
@stopyransky
Jul 16 2018 17:53
hi, i am getting filters to work in pixi but they seem to be applied only on part of canvas that contain Sprites/Graphics elements, Particularly for 'AdvancedBloomFilter' and 'GodrayFilter' anyone else having the same issue? i am applying filter on app.stage.filters, i would like filters to be applied on whole canvas / viewport
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 18:04
use filterArea
container.filterArea = renderer.screen
or app.screen
its a rectangle with coords (0,0,width,height) where w,h are CSS-measured( in fullscreen its innerWidth/innerHeight)
its automatically updated when you resize renderer, so its also handy when you need screen measures
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 18:21
@markknol wow. its merged already
my PR + 3 approvals + comment from author of resource-loader
i was sceptical about your case, but its success :)
Karol Stopyra
@stopyransky
Jul 16 2018 19:02
@ivanpopelyshev thanks a lot, it helped!
juwoni
@juwoni
Jul 16 2018 20:51
Hi
juwoni
@juwoni
Jul 16 2018 20:59
I am trying to mix Textures with shader. but It is not equal to result is without shader.
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 21:00
make a fiddle
juwoni
@juwoni
Jul 16 2018 21:00
okay
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 21:00
telepathy tells me that you forgot about "Ra,Ga,Ba,a" format of the texture
juwoni
@juwoni
Jul 16 2018 21:00
but it's not correct? I use this (1.0 - t1.a) t0 + t1.a t1
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 21:00
its premultiplied
second coefficient has to be 1
because t1 is already premultiplied :)
ONE_MINUS_SRC_ALPHA, 1 is default premultiplied blendmode
ONE_MINUS_SRC_ALPHA, SRC_ALPHA works for non-premultiplied textures but NPM is a big problem when you filter textures, so everything in web is premultiplied. by default
also if you use Filter and not just renderer plugin as in "pixi-plugin-example" or in "pixi-heaven"-multitexture renderer, you might have preformance problems because Filter requires extra frramebuffer switch. When your demo works, try to switch it to renderer plugin.
pixi-heaven SpriteRenderer is the best thing for now, but you have to CTRL+C the necessary code from that lib.
i hope you know typescript :)
juwoni
@juwoni
Jul 16 2018 21:09
Okay thanks for helping me. I'll try to solve the problem. :)
Ivan Popelyshev
@ivanpopelyshev
Jul 16 2018 21:47
just to be sure: (1.0 - t1.a) t0 + t1
that one will work in your case