westy Posted November 26, 2017 Share Posted November 26, 2017 I have a horizontally tiling texture that I want to use to create flexible ropes in PIXI. I followed the same general path as is mentioned here, and it works, however I do have a slight worry. Every different length of rope in this case means another texture in image memory with size proportional to the rope length. I want to have a large number of ropes, all of different lengths. This feels quite expensive to me - is there a more efficient way to do this that doesn't involve baking a new texture for every rope length? ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 26, 2017 Share Posted November 26, 2017 set texture wrapMode to repeat (required pow2 texture), and patch `PIXI.mesh.Rope` that way it produces different range of UV's, not 0-1 but 0-N where N is how many times texture was repeated. If you want the code, you have to wait someone who have free time to make an actual demo. I recommend to implement it based on my suggestion and not wait anyone, its not that difficult Quote Link to comment Share on other sites More sharing options...
westy Posted November 26, 2017 Author Share Posted November 26, 2017 Thanks Ivan, that sounds exactly like what I'm after. I'll give it a try. I don't really like the idea of forking PIXI functionality but I guess in this case it's a pretty subtle change. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted November 27, 2017 Share Posted November 27, 2017 You dont have to fork pixi, just extend PIXI.mesh.Rope and override whatever method sets UV's . Its supposed to be changed because there are many ways of improvement for rope and generated meshes in general, I even have special meshes in plugin https://github.com/gameofbombs/pixi-heaven . Its not possible to handle everything in vanilla pixi, our open-source library is supposed to be small. Quote Link to comment Share on other sites More sharing options...
OSUblake Posted November 27, 2017 Share Posted November 27, 2017 Here's an example in v3. I think I got the original idea from bQvle. Quote Link to comment Share on other sites More sharing options...
scythian Posted March 14, 2019 Share Posted March 14, 2019 Based on ideas in this topic I've been working on my project and created two demos for PIXI v5.0.0-rc2: (will not be much different in v4) 1. framing texture + downsample, not easy to work with coordinates, no actual tiling: https://jsfiddle.net/scythian/sta0e87u/ 2. extending mesh class + downsample, won't work without power of two texture: https://jsfiddle.net/scythian/rkx0vzuf/ The question is, could the second demo be made a part of the SimpleRope as it adds about ten lines to it? If not, where should I publish a custom mesh for v5? There are no extras anymore. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 18, 2019 Share Posted March 18, 2019 @scythian I think i'll take those demos to https://github.com/gameofbombs/pixi-heaven when I update heaven meshes to v5 Our custom meshes were made thanks to @finscn Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 18, 2019 Share Posted March 18, 2019 Anyway, you can use our codebase to make your custom meshes better. Its possible to integrate some or all advanced mesh features in pixiJS, but it requires time, at least a month or two of active review between us (@finscn, you , I) and rest of PixiJS core team. Of course if you found simple way to do that (small PR) it would be easier to review. Look at the bright side! Now we have a demo!!!!!! 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.