These are chat archives for pixijs/pixi.js

11th
Feb 2016
Not ready to put on github.. will do it tomorrow. But that seems to work. Maybe I'm missing something though.
Ivan Popelyshev
@ivanpopelyshev
Feb 11 2016 12:29
it works for alpha=0 and alpha=1 right?
I dont think it'll work for other values
because pixi works with pre-multiplied
vec4(color.r, color.g, color.b, 1) alpha vColor - that'll work
vec4(color.r, color.g, color.b, 1) multiplied by alpha
@MattOstgard you remember that blendMode issue? well, @GoodBoyDigital asked us to use pre-multplied as default mode
yeah, i think that's better
Ivan Popelyshev
@ivanpopelyshev
Feb 11 2016 12:49
problem is, you cant just create a shader per sprite, it will be very slow
so you have to create one shader and assign it to all sprites, and sprites must specify correct uniform values for that shader
Matt Ostgard
@MattOstgard
Feb 11 2016 16:27
@ivanpopelyshev the rgb image is actually premultiplied by the artist, which I think is okay to assume as long as it's communicated to the artist. Most artists would save out premultiplied without realizing that is what they are doing anyway.
I see at shader per sprite. I was using TilingSprite.js as an example, and it looks like it's doing it the wrong way. I will work on a version that extends sprite today.
Ivan Popelyshev
@ivanpopelyshev
Feb 11 2016 16:30
ok
so rgb can also be pre-multiplied , even if alpha doesnt exist there
ok, we asssume that its pre-multiplied :))
Matt Ostgard
@MattOstgard
Feb 11 2016 16:31
Yeah in photoshop you can just put a black background behind the original transparent image and that is the same thing
Ivan Popelyshev
@ivanpopelyshev
Feb 11 2016 16:32
awesome
Matt Ostgard
@MattOstgard
Feb 11 2016 17:17
can you think of a better name than "pixi-split-alpha-sprite" for this plugin?
Ivan Popelyshev
@ivanpopelyshev
Feb 11 2016 17:22
pixi-alpha-map :)
and in v4 i'll make special MAterials
that'll work with that kind of things
Matt Ostgard
@MattOstgard
Feb 11 2016 17:23
oh v4 will have some material system? sweet
Ivan Popelyshev
@ivanpopelyshev
Feb 11 2016 17:30
yeah, but it'll retain BaseTexture/Texture stuff
I'll just separate BaseTexture and Material, make them two childs of some meta-texture
and Material will have flags for shaders that are affecting "ifdef" directive
Matt Ostgard
@MattOstgard
Feb 11 2016 17:31
oh wow
very cool
Ivan Popelyshev
@ivanpopelyshev
Feb 11 2016 17:32
that way you'll be able to write a shader that can work both with simple sprites and with bump-mapped sprites , it'll be recompiled specially for it
Matt Ostgard
@MattOstgard
Feb 11 2016 17:34
Yeah awesome. Did you all decide to just support webgl or are you still trying to support regular canvas?
Ivan Popelyshev
@ivanpopelyshev
Feb 11 2016 17:35
Canvas support will work anyway
otherwise gameofbombs.com will lose some audience when I move it to pixi :))
Matt Ostgard
@MattOstgard
Feb 11 2016 17:36
ah still a lot of people out there with only canvas support? was hoping it would be under 10 percent by now
Ivan Popelyshev
@ivanpopelyshev
Feb 11 2016 17:36
Some heavy stuff like effective tilemaps and portals will work in canvas too
Matt Ostgard
@MattOstgard
Feb 11 2016 22:58
@ivanpopelyshev not working right now, but pixi-alpha-map lives here: https://github.com/MattOstgard/pixi-alpha-map
for some reason Shader keeps trying to check uniforms.alphaTexture.hasLoaded.. but it shouldn't be if uniforms.alphaTexture.value is defined. which it should be.
Ivan Popelyshev
@ivanpopelyshev
Feb 11 2016 23:35
oh
yeah, that's a bug
thank you , i'll look at it :)