Jump to content

ivan.popelyshev

Members
  • Content Count

    5321
  • Joined

  • Last visited

  • Days Won

    300

Everything posted by ivan.popelyshev

  1. /// <reference path="./global.d.ts"> then create global.d.ts nearby, with something like that: https://github.com/pixijs/layers/blob/master/global.d.ts Pixi exposes a number of interfaces in GlobalMixins for extending. Not all of them, but several that are usually used in plugins. It wasnt possible to move pixijs and plugins to TS+imports without this hack.
  2. Hi! You use gl_FragCoord in shader, and its really not reliable in pixi, because pixi renderTextures have flipped Y compared to main framebuffer. This was done to avoid flipping Y of all texture on upload, which is usual way of opengl/webgl. To avoid that thing, you have to actually use vTextureCoord. According to https://github.com/pixijs/pixijs/wiki/v4-Creating-Filters , you can get pixel coord from "vTextureCoord * filterArea.xy" m you need "uniform vec4 filterArea" for that. Btw, for v5/v6 its different, in case you'll move to next version of rpgmaker
  3. Sorry, was in train, couldnt answer due to bad internet https://github.com/pixijs/pixijs/issues/7771 Welcome to modern JS builders.
  4. You can change texture in https://github.com/pixijs/spine/blob/master/examples/hack_texture.md . As or changing colors - pixi-spine tints its meshes and , so you cant really tint that, you have to make a modified update function, or bone color, or something like that, im not entirely sure You looked in source code, right? https://github.com/pixijs/spine/blob/bc1afdf93d0fbafe6445e8c6245f3344bec615fc/packages/base/src/SpineBase.ts#L305-L308
  5. Usually when persistance introduced, issues are getting x3 times harder to track. That's why PixiJS doesnt deal with persistence - custom plugins do. If you dont see those plugins at https://github.com/pixijs/pixijs/wiki/v5-Resources and https://github.com/pixijs/pixijs/wiki/v6-Resources - that means no one cared enough to actually maintain those plugins and track them. Here is the plugin that doesnt save stuff, but allows a component approach, post is still in the first page of this subforum: https://github.com/WLDragon/oixi2
  6. See this? https://github.com/pixijs/pixijs/blob/5bd4c5bb683dca5a33e511277273a832342fb804/packages/filters/filter-displacement/src/DisplacementFilter.ts#L44 https://github.com/pixijs/pixijs/blob/5bd4c5bb683dca5a33e511277273a832342fb804/packages/filters/filter-displacement/src/DisplacementFilter.ts#L109 It doesnt actually set texture from sprite every time. You can patch applyFilter to do that let previousApply = DisplacementFilter.prototype.applyFilter; DisplacementFilter.prototype.applyFilter = function apply( filterManager, input, output, clearMode ) {
  7. because you didnt add "@pixi/interaction" in yout bundle. You have to make a bundle, you know it, right? Either use "pixi.js" and import stuf from submodules like "@pixi/display", either make your own bundle with this tool: https://pixijs.io/customize/ . If you forget to add some crucial stuff like "registerPlugin" for renderer - sprites might not work
  8. Pixi 6 doesnt have gl changes compared to 5.3 . If system was running, but now isn't - most likely its a new webgl problem. You need someone experienced with them , name of device where it can be reproduced, and how it can be reproduced .
  9. if you dont have renderTexture's , pixi can just restore the context if you allow it if you have generated content in videomemory - well, Refresh is the only way. another is to re-generate it. Here is another very helpful super-advice : find out whats wrong with your app. Maybe you eat too much videomemory. If you have minimal case, you can ask in https://bugs.chromium.org/p/chromium/issues/list?q=webgl&can=2 But, usually, there's no way to fight this thing Especially if you treat pixi and webgl as black box
  10. @pixi is a group name, to use it you have to be in contact with bigtimebuddy, because only he can give rights to npm @pixi packages. Really not worth it, just use "oixi2" like you do now
  11. To make it more pixi-v6-like, i recommend to add individual pixi modules as peer dependencies like here: https://github.com/pixijs/pixi-plugin-example you dont need "global.d.ts" hack and some other things, just peer deps & using them instead of main pixi. Added to https://github.com/pixijs/pixijs/wiki/v6-Resources#improvement-for-stage-tree anyway
  12. Here, I cloned it: https://codesandbox.io/s/pedantic-surf-0kdci btw, forgot to say that for codesandbox, options {crossOrigin: '*'} is required OK, so main problem is that you used the wrong key. This works fine: let sheet = PIXI.Loader.shared.resources["sheetData"]; Things are much easier when you use debugger. All you had to do is to place a breakpoint there and look in "resources" object.
  13. > Taking my evangelism to the next level might be cool as a direct contributor of documentation. There's https://github.com/pixijs/guides , our next level of docs. Hope you are ready that other people will search for you and ask for more stuff after you do the contribution My past commits are haunting me for years > I'm learning towards rolling a depth first or Dijkstra algorithm here. Dijkstra.. here? Why and how? Its a tree
  14. this comment was added somewhere in pixi v3. > Seemingly useful utility, but some examples would prove valuable - hit, or function outside of interaction events. Someone made processInteracitve. Other people modified it, added comments. I made custom interaction for Layers, then some people made their own custom changes in processInteractive, so I made a PR to main pixi repo to move this thing away to TreeSearch more excuses for me: 1. I'm not native english speaker 2. Some algorithms are better explained through code, not through documentation. 3. TreeSearch
  15. Here's pixi default treesearch: https://github.com/pixijs/pixijs/blob/7703aa1d66c1116c2a771d6e8f69a720619e979a/packages/interaction/src/TreeSearch.ts Here's custom for pixi-layers: https://github.com/pixijs/layers/blob/master/src/LayersTreeSearch.ts Because pixi-layers hacked processInteractive before, I made a PR to pixi to separate treesearch, so other people can write their own traversal functions. > There's no interface on that class. It was there even before full conversion to TS. Make a PR ===== btw, alternative events lib @pixi/events went live, and pe
  16. > Are there any examples of how to implement a custom TreeSearch? Ctrl+c, ctrl+v, change it. > Perhaps instead I should implement my own depth first / breadth first traversal functions and test point coordinates against bounds in a global space. That's basically your own TreeSearch, whats the problem?
  17. you are using `import` and webpack , right? You have to import stuff from plugins directly https://github.com/pixijs/layers#usage Or you may add "import * as display from '@pixi/layers' " and put it to your "const PIXI"
  18. You did it right, it should work. Configure your server correctly.
  19. take shader from https://pixijs.io/examples/#/mesh-and-shaders/triangle-textured.js as a base remove texture distance(vec2(0.5), vUvs) will give you from 0 to 0.5 for circle, and more than 0.5 for outer part If you want good smoothing - oh , that's more difficult, multiple options to get width of pixel in UV normalized coord: 1. use fwidth() , but you have to enable derivatives for that and add "ifdef". or switch to webgl2 and es300 shader format - it just works there. 2. calculate scale in vertex shader, pass it to varying Now, you only need a function th
  20. As for best practices, all the variants how to do it - im sorry, that' sa big topic, i explained this at forums many times but i failed to have time to compile all that in a book. Please provide demo of 1000 graphics that is slow, then we can talk about it.
  21. colored dynamically with one or multiple colors? IF 1000 graphics wont work for you - yes, you can make shader that will handle color. it can be mesh-shader, it can be batching.
  22. pixi "texture cache" is an easy things - it adds texture to the map. Just look where its done in source code. There's no docs, no articles, ande every time someone stumbles across it the answer is only one - look in the source code. I usually dont use cache at all and empty it every time with "utils.clearTextureCache" and basetexturecache too. This thing is not needed. As for multiple levels - you can try upload those to different mip levels in webgl texture, in that case you can make Texture Resource (look example with gradient, but add bot texImage2d's on different levels). Yo
  23. make one biome edge to go on top of another biome edge and add gradient. oh right, pixijs doesnt have gradients, you have to use your own shader for that, or wait when i add it to something like graphics-smooth or maybe gradient texture on a rope can do it
  24. processInteractive was moved to TreeSearch so you can make your own "renderer.interaction.search = myTreeSearch"
×
×
  • Create New...