Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by ivan.popelyshev

  1. or make canvas2d of pow2, draw image there, make texture out of it in pixi, enable mipmapping. Yes, this behaviour is default for ThreeJS, but pixi does like to force users to learn stuff
  2. You cannot change anything inside graphics, you can just "clear" and refill it. However, there's a "tint" property. Make white rectangle, then change "tint" whenever you want. Alternatively, use Sprite with "Texture.WHITE" as texture, and tint it.
  3. There's a demo for v5 too https://www.pixiplayground.com/#/edit/Ngi8fYSPwGGZYnfGIHb9O It was mentioned here: https://github.com/pixijs/pixi.js/wiki/v5-Hacks#re-use-previous-frame-of-filtered-object for v6 you have to update the code a bit because filterSystem most probably was changed
  4. You can also move it to pixijs github discussions , there might be more people from the team
  5. PixiJS binds only existing textures. However with all going on in reset() there's probably a case we missed that leads to unbound texture when multi-texture batcher works. However I'm sick in bed, so you have to wait for someone else to do it, or find on your own , its all in TextureSystem , and batcher does its thing through binding textures array somewhere in the same file, or maybe in BatchSystem / AbstracthBatchRenderer
  6. Well, you have to update pixi-layers to latest, and it will spawn deprecation warnings anyway. Its not yet migrated to new plugin format , but it works Also, probably update viewport. 5.2 5.3 and 6.0 have serious changes for it, i dont know whether it was re-published already for latest v6 features. Theoretically, on v6, viewport should be much faster
  7. "Sprite.from", aka "Texture.from" is sync function and it does load texture at that right moment, only if texture was already in browser cache. So if you call render() only one time, just after you used from() - no guarantees that it will be rendered, after all, how to render something that is not loaded yet? Welcome to javascript. How to solve it: 1. use pixi loader, like in all examples 2. the usual const tex = Texture.from("my.png"); function ready() { //do render } if (tex.baseTexture.valid) { ready(); } else { tex.baseTexture.on('loaded', ready); }
  8. that's the usual 4x3 matrix in 3d, pixi doesnt have it. Emulation is possible , like here: https://pixijs.io/examples/#/plugin-projection/iso-basic.js To do that thing you have to 1. Know how pixijs transforms work. completely. all fields. position,scale,rotation,skew, whatever. 2. Know usual 3d math for basic translation/rotation 3. maybe experiment with pixi-projection or pixi-3d plugins. So, its not exactly newbie material. However you can do it easily if you know how other 2d/3d renderers work internally, pixi is not far behind, its just doesnt have public API for
  9. There are no big breaking changes like there were between v4 and v5. There are breaking things for typescript, we changed the way we do typings. There are also changes in rendering between 5.1 5.2 and 5.3. If you try to update - im here to help. Which plugins do you use?
  10. for me on PC mipmap=2 makes everything better , whether its linear or nearest
  11. alternatively: make image power-of-two size btw ThreeJS does it automatically for all textures. pixi doesnt do this barbaric method.
  12. oh wait, i see it. not pow2.. anyway, check if device has webgl2. if not, you can just host several versions of image - downscaled 2 times, downscaled 4 times and so on, and download one that is a bit bigger than screen. Alternatively, you can do it with canvas2d manually, and give pixi corresponding texture. The whole problem is that downscaling more than 2 times requires mipmapping or manual scaling 2/4/8 times whatever will be close to your resolution
  13. whats the size of texture? does mobile have webgl2?
  14. > Also which method will be faster , to draw the lines or to load them as Sprites from image files ? I know the amount of operations is low here - only 10 lines , but in theory loading them from .png files looks to me the faster method. I dont think there's a difference on 10 lines
  15. mipmapping, probably. texture has to be power-of-two size , or it has to be webgl2 and "baseTexture.mipmap = PIXI.MIPMAP_MODES.ON"
  16. need minimal demo. Yeah, framebuffer might be issue, add "renderer.reset()" before "render" too :)))
  17. strange, it should work. can you make minimal demo in pixi-playground or any kind of jsfiddle sites?
  18. > It seems such an obvious problem when tiling sprites welcome to OpenGL. Well, there's a solution - special shader that clamps coords according to the frame, but i dont have it for ParticleContainer. To think about it, i dont have it currently for anything, the only easy-available solution is in "@pixi/tilemap". For everything else you have to write shader from scratch , because currently im too busy with other things
  19. Pixi has special method, "renderer.reset()" that resets all the pixi state cache and unbinds current vao/buffers. If your renderer has something like that, then you can just reset them both before and after usage, and it'll work. I did it many times with pixi and threejs. You can even share textures if you know how to inject existing webgl objects in renderer wrappers.
  20. the only way to do it right now is nativeLine. Yes, pixijs is so many years and we still dont have adaptive scaling for lines.
  21. the only objct that dstroys its texture for sure is Text. Are you trying to reuse old text somehow? If not, then i dont know what else can go wrong, need more information. debug
  22. > CreateImageBitmap caused some strange behaviours on sprites that have something transparent. welcome to premultiplied alpha. pass a param named like this in this funtio > From your experiance do u think utilizing webworker to do pixi work is worth? No, its not worth it. When its actually worth, it doesnt have to do anything with pixi
  23. > I read somewhere to preload the animations before hand and just make them visible when needed basically, PIXI.prepare plugin that actually uses"renderer.texture.bind(myTexture)" . However there is "createImageBitmap" function and you can use it with pixi resources, but we turned it off by default because we dont actually have good async mechanisms to notify user that everything is loaded, and basic "createImageBitmap" usage affected many parts of pixi. You can enable it if you read the source code first, because i dont remember where is this setting > Also is there pos
  24. Use SpectorJS chrome extension to see number of drawcalls in frame and whether your re-use of textures actually works. Also, you have to take profile of this app and see which JS functions are slow.
  25. the idea is to generate all possible notes, and re-use those textures. Better if its actually one texture and you use regions of it "new PIXI.Texture(baseTexture, frame)"
  • Create New...