ptsans Posted January 12, 2021 Share Posted January 12, 2021 Hi, help me figure out how it works! I have an abstract texture atlas as shown below. Then I create a simple mesh from geometry (red borders) and material (each geometry has its own uv coordinates, matching the atlas). How can I transform a texture tile within a geometry, without changing the geometry itself, as shown below? Does it have something to do with framebuffers? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 12, 2021 Share Posted January 12, 2021 You need custom shader with this geometry that 1. applies extra transform (matrix) to texture coords in vertex shader 2. in fragment shader, looks in uniforms for texture frame (you have to pass it!!!) and if current UV's are out of bounds - discard the pixel Parts of code you can take from SpriteMaskFilter: https://github.com/pixijs/pixi.js/tree/dev/packages/core/src/filters/spriteMask you can make extra Transform variable inside your mesh, specify position/scale/rotation/pivot there , updateLocalTransform() it, take the worldTransform matrix to uniforms. If you want complete solution - sorry, you have to wait when someone will have 10-15 minutes for that, i dont have now ))))) 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.