These are chat archives for pixijs/pixi.js

29th
Feb 2016
Matt Ostgard
@MattOstgard
Feb 29 2016 19:57
@ivanpopelyshev or @englercj am I wrong in thinking that if I have an second texture in a shader (not filter) that syncuniforms should be updating both textures rather than just the standard uSampler uniform?
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 19:58
yep
Matt Ostgard
@MattOstgard
Feb 29 2016 19:58
yep I'm wrong? or yep it should be?
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 19:58
syncUniforms is juat a "for" cycle which updates evreything
look inside
Matt Ostgard
@MattOstgard
Feb 29 2016 19:58
okay yeah thats what I thought.
I'm having issues where it won't update the alpha texture in pixi-alpha-map
as it is right now I'm overriding the alpha texture during _renderWebGL which I realize now is wrong. but even when I don't override it, it will still only use one texture from a sprite instance when there are multiple sprites using different textures.
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:03
Yeah
"which I realize now is wrong" what?
Matt Ostgard
@MattOstgard
Feb 29 2016 20:03
hold on
that line.. when I remove it it still doesn't function properly
let me take a screenshot
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:04
that's not how it supposed to work
you have to override uniform value
this.shader.alphaTexture = this.alphaTexture;
how is it working? where is uniform.value?
Matt Ostgard
@MattOstgard
Feb 29 2016 20:10
right yeah.. dang it
fixin
oh wait no. it's in alphamapshader.js
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:12
good
Matt Ostgard
@MattOstgard
Feb 29 2016 20:12
Screenshot-2016-02-29-12.04.09.jpg
Screenshot-2016-02-29-12.05.04.jpg
first image is just rgb and is correct
second image is getting only alpha from first sprite
(only showing alpha in second image)
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:13
ok, now i understand
it seems that it doesnt synchronize it
when switching to other sprites
*sprite
Matt Ostgard
@MattOstgard
Feb 29 2016 20:14
hmm..
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:15
these two sprites have different texture , right?
first textures
Matt Ostgard
@MattOstgard
Feb 29 2016 20:15
I don't see why though. syncunforms seems pretty straight forward
yeah
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:16
show me how alphamapmovieclip works
looking at it at your repo
Matt Ostgard
@MattOstgard
Feb 29 2016 20:16
actually that was alpha movieclip
both use the same shader though
zipping up what I have
oh shit hold on
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:18
how do you compose alpha textures?
Matt Ostgard
@MattOstgard
Feb 29 2016 20:18
yeah okay sorry forgot I was still overriding alphatexture in renderwebgl
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:18
for your movie clip
Matt Ostgard
@MattOstgard
Feb 29 2016 20:18
it's fixed
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:18
" I was still overriding alphatexture in renderwebgl" what?
its how it works
Matt Ostgard
@MattOstgard
Feb 29 2016 20:19
I had removed the line: this.shader.alphaTexture = this.alphaTexture;
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:19
what is fixed exactly?
oh
Matt Ostgard
@MattOstgard
Feb 29 2016 20:19
in movieclip
but not in sprite
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:19
OOOHH
you can just extend Sprite to MovieClip
sorry, wrong idea
Matt Ostgard
@MattOstgard
Feb 29 2016 20:20
thanks man really needed a second set of eyes on that
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:20
i still dont understand what have you changes
*changed
Matt Ostgard
@MattOstgard
Feb 29 2016 20:21
I just removed that line 55 in AlphaMapSprite and AlphaMapMovieClip
when i was having that issues I had removed it in alphamapmovieclip, but not sprite
and it was rendering sprite and movieclip on that screenshot.
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:23
are you using different shaders for two f them?
Matt Ostgard
@MattOstgard
Feb 29 2016 20:24
same shader
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:24
same INSTANCE of shader?
you sure?
ok wait
now i undersatnd why it cant work at all in pixiv3
because you setting value for previouis batch, obviously
ah
no, verything is right
Matt Ostgard
@MattOstgard
Feb 29 2016 20:25
yeah :(
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:25
its supposed to work
please upload latest vesion and i'll look at it
and upload your demo too somewhere
Matt Ostgard
@MattOstgard
Feb 29 2016 20:25
as it is? really?
okay hold on
Matt Ostgard
@MattOstgard
Feb 29 2016 20:39
that version works for me. I removed the alphatexture override lines (line 55)
Ivan Popelyshev
@ivanpopelyshev
Feb 29 2016 20:45
its not supposed to work this way
because , really, how exactly are you assigning alphaTexture to shader?
ugh, i have to make a pause
need to take care of my part in pixiv4
then we'll move your stuff to pixiv4
because there's no sence in doing this for v3 now
Matt Ostgard
@MattOstgard
Feb 29 2016 20:55
Yeah. The stuff I'm working on uses v3 though and we arent ready to move to v4 yet
Stepped away from my desk. Will be back in a sec
Matt Ostgard
@MattOstgard
Feb 29 2016 21:01
something came up bbl
Matt Ostgard
@MattOstgard
Feb 29 2016 21:18
I see what you are saying now..
yeah it only looks like it's kinda working because of premultiplied blending
pushed up a revert