These are chat archives for pixijs/pixi.js

31st
Oct 2017
@R_Talon_twitter
Oct 31 2017 14:09
Hello!! Somebody know about Texture with black color background + mask for performance?
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:18
png+jps?
*png + jpg?
@R_Talon_twitter
Oct 31 2017 15:18
yes yes
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:19
only for better network fetch
@R_Talon_twitter
Oct 31 2017 15:19
yes, reduce size
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:19
pixi cant do that, you have to hack it
@R_Talon_twitter
Oct 31 2017 15:19
oohhh yes yes hacking xD
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:19
a few people did it
@R_Talon_twitter
Oct 31 2017 15:19
with erotic result? :P
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:19
im too busy to provide you with code or references (
@R_Talon_twitter
Oct 31 2017 15:20
ooh dont worry
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:20
the problem is that mask wont work for it
@R_Talon_twitter
Oct 31 2017 15:20
I'm searching information
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:20
you need to use special blendmode that takes alpha from one image and RGB from the other and multiplied RGB by that alpha
and put that in renderTexture
@R_Talon_twitter
Oct 31 2017 15:20
yes
BlendMode.ADD
not add.,
you need different constants for alpha and for RGB
alpha must be copied from one texture , RGB from other, and multiplied by that alpha
then you render two sprites in one renderTexture and use it.
@R_Talon_twitter
Oct 31 2017 15:22
yes yes i know the theory
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:22
i recommend to do it for big image
dont do it for small ones )
@R_Talon_twitter
Oct 31 2017 15:22
I have huge textures
4096
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:22
ok, that's fine
@R_Talon_twitter
Oct 31 2017 15:22
around 2-3 MB
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:23
dont forget to remove png and jpg after you do that
@R_Talon_twitter
Oct 31 2017 15:23
using pngQuant to reduce size
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:23
destroy those textures after you create renderTexture
otherwise you'll consume too much mem
good luck.
@R_Talon_twitter
Oct 31 2017 15:23
ok ok, I'm looking your link
thanks you!! you are a crack!
Ivan Popelyshev
@ivanpopelyshev
Oct 31 2017 15:26
Ж)