CamO Posted September 7, 2020 Share Posted September 7, 2020 (edited) Hello, I am trying to create a dynamic transition from one image texture to another shape and not a created mask transition. In short I am trying to create the effect show on the link below. and one other question is it possible to click on a single stroke that is part of the. borderline of a graphic shape? Thanks for your time and thumbs up for your library ! Edited September 7, 2020 by CamO forgot a question Quote Link to comment Share on other sites More sharing options...
Exca Posted September 8, 2020 Share Posted September 8, 2020 (edited) You could do that by creating a shader with two texture inputs which blend between those two. The actual code & math inside the shader is out of my scope in reasonable time. As a starting point I would propably try doing somekind of convolution with previous frame as feedback and then moving towards target image. This is the closest example for blending. In the example a perlin noise image is used to determine the blending. In your case that would be the shader somehow morphing the images. https://pixijs.io/examples/#/mesh-and-shaders/multipass-shader-generated-mesh.js Edited September 8, 2020 by Exca Added example link. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 8, 2020 Share Posted September 8, 2020 > is out of my scope in reasonable time. Im gonna steal that phrase Exca 1 Quote Link to comment Share on other sites More sharing options...
CamO Posted September 9, 2020 Author Share Posted September 9, 2020 Thanks Exca I will check it out! @ivan.popelyshev hahaha ! With the amount replies you are giving out, it will come in handy for taking breaks Quote Link to comment Share on other sites More sharing options...
Nour Ashraf Posted May 18, 2021 Share Posted May 18, 2021 Hello, I'm completely new to PixiJS, Webgl and the concept of shaders and so on. However, I'm trying to learn them currently and I would like to refer me to useful sources that would help me in my learning process. Moreover, I want to eventually try and implement the above transition between images. I want to know if thats even possible? Thanks a lot in advance! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 20, 2021 Share Posted May 20, 2021 Do you know how to do that transition in general algorithm, without any pixi or any other renderer? Quote Link to comment Share on other sites More sharing options...
Exca Posted May 20, 2021 Share Posted May 20, 2021 Getting to know how shaders work would be a good first step. Sites like these help: https://thebookofshaders.com/https://www.shadertoy.com/https://webglfundamentals.org/ Then looking into some whitepapers about texture combinations or finding some example code how that is done in cpu/gpu would help in understanding how you would go on creating a webgl compatible version running on gpu. Overall the transition shown in the video is not the easiest thing to tackle. As I said above, the way you would do that in pixi is having a shader that has 2 texture inputs and then it mutates the uv-mapping and how the two textures are blended together, but the actual math related to that takes plenty of time to create (at least for me). If on the other hand you already know the math to calculate how the transition happens, then implementing it should be pretty straightforward learning how glsl works and then implementing a custom mesh (or filter) in pixi. There's lot of shader examples in https://pixijs.io/examples/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.