uniforms type sampler2D #492
-
Hello, for 3 weeks I have been trying to create a filter that will serve as a transition between two textures. I have tried this many times with shaders but with PIXI. V8+ I definitely can't. The basic reason is that I can't declare a sampler2D variable and therefore have access to it through uniforms. I would be very grateful if you have any ideas |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Hello! I can help, but i need demo that is failing |
Beta Was this translation helpful? Give feedback.
-
Hello, thank you very much for your responsiveness. In the meantime, I managed to overcome the problem with passing textures as filter parameters. But... a new problem appeared :-) The textures are stretched and deformed relative to absolute coordinates and not relative to the sprite to which the filter is applied. Here is a link to the class - (https://github.com/yohannesArt/pixi-transition-filter/blob/main/transition%20_filter.mjs) I'll describe what happens when the sprite is fully visible in the window the texture is visualized relatively correctly. When scrolling and part of the sprite is outside the window the texture is deformed and takes up the space of only the visible part, becoming distorted. |
Beta Was this translation helpful? Give feedback.
-
If you need it applied only to Sprite and not whole container, you can use Mesh shader instead. https://pixijs.com/8.x/examples/mesh-and-shaders/triangle-textured if you want to apply it to Sprite because of anchor/texture origframe and other features - "batch plugin" feature has been merged but i didnt get it how it compares to whatever we had in v7 yet :( |
Beta Was this translation helpful? Give feedback.
If you need it applied only to Sprite and not whole container, you can use Mesh shader instead.
https://pixijs.com/8.x/examples/mesh-and-shaders/triangle-textured
if you want to apply it to Sprite because of anchor/texture origframe and other features - "batch plugin" feature has been merged but i didnt get it how it compares to whatever we had in v7 yet :(