These are chat archives for pixijs/pixi.js

25th
Sep 2018
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 10:55
hi
https://webglfundamentals.org/webgl/lessons/webgl-render-to-texture.html
read in data (via a texture) , step 2 -> do some calculations on the data , step 3-> get date from the texture without plotting it to the canvase
basicly is what i want, not sure wich steps are possible, in webgl2
is this possible at all?
basicly step 1 -> load up data via a 2Dtexture, do some calculations (like a difference filter) -> put output into a nother texture (no rendering on the canvas) and get the data somehow into a typedarray
how to do this?
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 10:57
@onselakin well, people use different things.
@Jacob_Bogers_twitter its possible in webgl1.
look how "PIXI.extract" thing works
its sounds like you need more advanced code for this
so, 1. look there 2. understand how it works 3. make your own version
as for "load up data via 2Dtexture" - its a problem with TextureManager, its not possible to load simple array through higher pixi interfaces
pixi-heaven and pixi-super-atlas plugins have advanced version of TextureManager that can do that
pixi-v5 can also do that :)
is i guess your case requires to know BOTH webgl fundamentals and pixi architecture
dont think its a child walk
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:01
i am the creator of blasjs
and librmathjs
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:01
good :0
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:01
basicly i want to do these operations in webgl fragment shaders
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:02
ok, that's a good idea, especially if you want to do something like FFT
however downloading data from videomemory makes a serious lag
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:02
well, BLAS is underpins most of the mathematical operations of python, mathlab and R
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:02
because its synchronous. the only synchronous operation in webgl
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:03
ok
^ is this the approach i would take
read texture -> do some calcs -> output texture
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:03
what important is about webgl-2 is "transform feedback"
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:03
aha
whats that?
i am webgl noob
sorry for stupid questions
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:03
then learn more webgl :)
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:03
i AM
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:03
i think its possible but i dont know of libs that use it
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:03
just getting my bearings
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:04
so yeah, you are on the right way
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:04
i dotn want to use libs ideally
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:04
you can use pixi to setup shaders better, i recommend pixi-v5 for this
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:04
i made a stupid rotating prism (no libs)
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:04
but , again, there are no docs about this kind of task
so you have to learn pixi internals too , and how to work with FrameBuffer and other things
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:04
thats my problem ivan, i am piecing this all together
ok
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:05
yeah, take v5
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:05
so you say pixi gat "eat" textures and also "spit them out" to typedarrays?
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:05
well, I am sure that you will have to modify some of its internals
you have to understand how TextureResource works and how "extract" plugin works,
maybe look at sequence of operations that Specter will give you
the problem is that its not possible to do by using just higher pixi interfaces
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:06
ok
i guess you are right
will have to open up the hood on this one
Ivan Popelyshev
@ivanpopelyshev
Sep 25 2018 11:07
something will be missing because no one asked for this task before
however TextureResource in v5 allows to upload typed arrays
and low-level webgl in v5 is easier to use
no need to upload all those uniforms manually or configure shaders
Jacob Bogers
@Jacob_Bogers_twitter
Sep 25 2018 11:08
ok