ivan.popelyshev

Members
  • Content Count

    3905
  • Joined

  • Last visited

  • Days Won

    133

Everything posted by ivan.popelyshev

  1. I'm glad you solved it! So your resource is basically BufferResource that can be updated.
  2. http://pixijs.download/release/docs/PIXI.interaction.InteractionEvent.html#stopPropagation
  3. > Is there a list of such components someplace You are the first one who requests this list. > Is there documentation anyplace that lists the various renderer plugins developed by the PIXI team and when I would or wouldn't use a particular plugin? Again, you are the first one Maybe after full TS conversion, maybe when there will be at least 5 or so people like you who experiment with different bundles of pixi - we will have those lists as a part of documentation. =============== > So, this "BatchRender" plugin, if omitted, does crash when using the WebGL renderer. > Perhaps there is no point in using the BatchRenderer in a canvas context since there is no GPU to which textures need to be uploaded. BatchRenderer made for WebGL. I dont know why do you register it for canvas when canvas has one of its own. https://github.com/pixijs/pixi.js/blob/dev/bundles/pixi.js-legacy/src/index.js#L19 https://github.com/pixijs/pixi.js/blob/dev/packages/canvas/canvas-sprite/src/Sprite.js#L21 CanvasRenderer mirrors the old architecture of pixi v3-v4, it doesnt have systems, its not compatible with any of webgl systems/plugins. Only Accessability and InteractionManager can be canvas/webgl renderer plugins. =============== PixiJS wasn't planned on UML diagram. All those things were made without big planning. We are going step-by-step, maybe in a few months our architecture will be in place you somehow imagined it supposed to be, but right now it is not. > But running on intuition isn't very satisfying. There's got to be a guide on this right? All this modularity was achieved naturally. 7 years evolution of library, all those years we were growing community - and here you are , the first one who wants to use modularity by using intuition and not knowing all the code. It was not possible before.
  4. I see you've tried many things 1. re-creating TextureSystem second time 2. resetting the renderer state, binding/unbinding resource to baesTexture 3. binding/unbinding resource to baseTexture on every upload Unfortunately, that all should not affect behaviour. I dont know what is wrong with your case, I dont actually have websocket server with a video locally. Even without video, I dont know what is supposed result of that demo and what you see is wrong with it. Can you provide more information? I'm sure I can fix that and make your code much smaller if I at least see the bug with my eyes However, you use pixi 5.2.0 - maybe 5.2.1 or dev version ( pixijs.download/dev/pixi.js ) will work better, I remember we fixed something related to texture bind
  5. You can move whole container that contains eggs. You can create extra container if you want only part of eggs to be moved. Also the code your supplied has to work, I dont see whats wrong with it. Please post a demo on codepen,jsfiddle,codesandbox or pixi-playground.
  6. > and have followed the instructions on the documentation for the new way with V5 Where did you see those docs? According to https://github.com/pixijs/pixi.js/wiki/v5-Migration-Guide#renderer-parameters aoptions should be the only param, "800,600" shouldn't be separate. Give me a link please, I'll fix them Your code looks fine. If moving renderer size to options dosnt help, well, I suggest you to use chrome devtools to debug- look in the console, place a breakpoint, e.t.c. . If you dont see anything strange - you can post a demo and people will look at it.
  7. > Unfortunately, despite being comfortable with the PIXI documentation and looking through PIXI source code, it is proving difficult to navigate the plugins that I need to make basic things work. I think you are tired. Your code looks good enough and you are really close to your target. Maybe if you ask a few questions like the one about renderCanvas - it'll be fine Praise @Mat Groves that pixi is just a lib and not a framework. > It crashes when it attempts to call the "renderCanvas" method on the Container object here. Container is in display, canvas part is in canvas-display. > Is it really necessary to create canvas objects at the point when a module is imported? Perhaps move some of that logic to a constructor? Running pixi in server environment is not considered a priority for us, there are many other pressing matters that affect architecture. Use "node-canvas" or any other thing that makes shim.. and now I remember that thing: https://github.com/Prozi/pixi-shim In case you fork pixi and change those document-related parts, track which changes you make , to upgrade your pixi version later. I made many big changes in pixi forks,. for example full typescript fork 2.5 years ago. We are finally moving main repo to TS now. Part of your problem - tree shaking - existed for a long time, but https://pixijs.io/customize/ is only year old or so. Same way, making pixi server-friendly will really take time not because of amount of code but because its not a priority and this feature cannot in any way obstruct our code. Just imagine it from maintainer point of view: we will have to reject PR's without lazy initialization, that's a serious change in review process!
  8. OK, you are my tester now. Please look at https://github.com/gameofbombs/pixi-heaven/tree/master , there's a build in "dist" folder. It works only with 5.2.0 or 5.2.1 . Test "spriteMask" feature, whether there are any jitters or strange effects. If you find such effect - please make a small demo so i can debug it faster. Its difficult for me to check all the cases.
  9. It should work, I have no idea what is wrong there. Place a breakpoint in that place and see if removeChild affects children array. If you are too tired to debug , then reduce a demo to minimal lines of code and post it on codepen/jsfiddle/pixi-playground.
  10. > I expected the visual propety to be deleted, removed from the stage. Sorry, I dont understand you. Is it visible on screen? Are you sure its child of stage and not a grandchild?
  11. Hello, and Welcome to the forums! My answer will be very short: what do you expect here? that console shows null? That object will be empty? "removeChild" just removes this particular container from another container childs list, and maybe modifies a few variables related to that. If you want clear object fields, call destroy() on it, it will also call removeChild. If you want to get rid of object from javascript memory, well, you have to read have JS GC works, that's a bigger topic.
  12. Welcome to the forums Added to wiki: https://github.com/pixijs/pixi.js/wiki/v5-Resources#tutorials Yeah, that's app that draws in one drawcall (checked with SpectorJS) Please post it here too:
  13. @MariaK Welcome to the forums! There is a thing I call a telepathy - how fast someone can determine the other person problem without reproducible demo. Sometimes people guess right by only a few words, yes, but it takes experience. Thomasdah has 2 posts. His last post was in 2016. You have 0.1% probability that this kind of question will be answered by someone in a week. I recommend you to reformulate your question, give more information and maybe explain what in my solution is difficult to understand. Reproducible demo is the best attachment to question, but we can try use my telepathy.
  14. easy, just call "baseTexture.update()" , it will chang all updateID's , and TextureSystem wlll see that texture was changed on bind: https://github.com/pixijs/pixi.js/blob/1d09bfca1ae1a2fcdcca4c8a80ed59f605abcd76/packages/core/src/textures/BaseTexture.ts#L507 https://github.com/pixijs/pixi.js/blob/1d09bfca1ae1a2fcdcca4c8a80ed59f605abcd76/packages/core/src/textures/TextureSystem.ts#L141 When you call "baseTexture.setSize()" it changes ID's too. Actually, if its only the format you've changed, you can just set "baseTexture.format" and use our regular BufferResource. As for bind problem you encountered, I think I need to see your demo to solve that.
  15. Out docs dont have this entry, but: when you use spritesheet manually, you have to call "parse" method: https://github.com/pixijs/pixi.js/blob/1d09bfca1ae1a2fcdcca4c8a80ed59f605abcd76/packages/spritesheet/src/Spritesheet.ts#L167 Because, someone thought that parsing is too slow there and has to be async. It wont be async if its less than 1000 textures though
  16. > Also mesh shaders are great, found about them the other day. I love pixi js! Thank you! That's how we covered our old problem that there was no plain shader in pixi. ThreeJS has its RawShaderMaterial and Geometry-Material pair, now we have it too.
  17. However, if you do manual binds and other stuff, please call "renderer.reset()" method so pixi knows that someone else worked with that context. Yes, we store current boundTexture and active location top optimize our webgl commands sequence. Its here: https://github.com/pixijs/pixi.js/blob/22c9cc00adaafbfd3a3f51dc74f3c9b4925686dd/packages/core/src/textures/TextureSystem.ts#L127
  18. Hello! PixiJS binds textures automatically, you put a link to texture in shader uniform - and it'll work: https://pixijs.io/examples/#/mesh-and-shaders/triangle-textured.js However, you want to upload texture for yourself. In that case you can use our texture resource API: https://pixijs.io/examples/#/textures/gradient-resource.js You dont need to create gltexture nor to bind it. Just call texImage2D inside "upload" method. As for texture params, you can either set them in baseTexture wrapMode/scaleMode, either override "style" method of resource, it has the same signature as upload. If you worried that PixiJS operations wont be optimal, you can snoop them through https://spector.babylonjs.com/ and see that texture params are exactly the same. Welcome to the forums!
  19. Hello, and welcome to the forums! DisplacementFilter is one of our selling points for web developers who use WebGL for the first time. However, its also a small lie - to really understand whats going on you have to learn many things. DisplcamentMap shader works through Red and Green channel, Red is supposed to be offset by X and Green by Y. If you just use grayscale - you get the same offset by X and Y every time, so you have to edit the channels separately. Gray 808080 is the neutral color- nothing is moved at that pixel. https://github.com/pixijs/pixi.js/blob/22c9cc00adaafbfd3a3f51dc74f3c9b4925686dd/packages/filters/filter-displacement/src/displacement.frag#L17 "map.xy" is actually "map.rg" , red and green channel from displacement map texture.
  20. Hello, fellow shaders enthusiast and blurshadow slayer! Welcome to the forums! Well, first I have to notify you that if you dont use `uSampler` , you dont actually need to use Filter, you can write mesh shader: https://pixijs.io/examples/#/mesh-and-shaders/triangle-textured.js and put your texture size through uniforms. Filter is supposed to process whatever is inside container, not to just paint something else instead. Its also used in case you need multiple passes. Even if you dont use `uSampler`, its still calculated in temporary RenderTexture that you dont see, and inputPixel is calculated for it. PixiJS takes 128x128 temporary texture , and inputPixel is (128,128,1/128,1/128). Your texture size is (80,80). When I put 1/80 to your shader- it looks fine. Either you pass your texture size as a uniform, either you get rid of filter and write mesh shader. You have to pass texture size as a uniform anyway
  21. OK, we merged it in dev, please check it.
  22. Thank you! Now I see that I have no idea how to trigger that. Do you use RenderTexture?
  23. First-class citizen of PixiJS tree is Transform. It has position, scale, rotation, pivot. Resulting matrix is passed down to children. Width and height are by-products, they are calculated fields and if you set them - you can get in trouble if you dont read source code on how do they work (like in Adobe Flash). If Pixi actually cared about layout, it wouldn't be a small rendering library. Its your job to implement it or find UI kits that support pixi. There are so many ways to do that, usually people write their own systems. One of best UI's was pixi-ui - but its not ported to v5 yet, and it has almost no docs. It mirrors Unity UI. There are GUI systems that work with both pixi and phaser, I dont remember names nor links, please post them here if you find. As if you need basic stuff just for a few elements - it always better to write your own. @jonforum knows many tricks, you can search and read his posts. Its fine to post questions like that on forum, because you never know which things have standards in community and which ones people usually write on their own.
  24. Use not-minified js file, place a breakpoint in a deprecation, figure out where is it called from, post an issue or Pull Request in https://github.com/pixijs/pixi.js