Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixi V8 Upgrade #1495

Draft
wants to merge 65 commits into
base: main
Choose a base branch
from
Draft

Pixi V8 Upgrade #1495

wants to merge 65 commits into from

Commits on Sep 17, 2024

  1. Configuration menu
    Copy the full SHA
    ef87bf0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4f91923 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dcc9e50 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c12c6a9 View commit details
    Browse the repository at this point in the history
  5. package updated to pixi V8

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    489229b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a255e94 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d189fb7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5dc3600 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    3912c96 View commit details
    Browse the repository at this point in the history
  10. package updated to pixi V8

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    71e6321 View commit details
    Browse the repository at this point in the history
  11. fix async issue (thanks Ben!)

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    c84c17f View commit details
    Browse the repository at this point in the history
  12. new name schemes updated for v8

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    70fdd7d View commit details
    Browse the repository at this point in the history
  13. name changed to label

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    d40ffe3 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    46e9ef9 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    454c62e View commit details
    Browse the repository at this point in the history
  16. naming schemes updated to V8

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    588f5fe View commit details
    Browse the repository at this point in the history
  17. updated to be async

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    7f3db22 View commit details
    Browse the repository at this point in the history
  18. view changed to canvas

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    3c493ff View commit details
    Browse the repository at this point in the history
  19. remove console.logs

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    975e40f View commit details
    Browse the repository at this point in the history
  20. pixi v8.3.1

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    a1a1fa1 View commit details
    Browse the repository at this point in the history
  21. Working on pixi async init startup

    Because Pixi init is async, we need to keep track of that promise, and delay
    many things until after it has settled.
    bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    ee73c70 View commit details
    Browse the repository at this point in the history
  22. setParent changed to just parent

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    b499b8c View commit details
    Browse the repository at this point in the history
  23. view changed to canvas

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    02d4310 View commit details
    Browse the repository at this point in the history
  24. name changed to label

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    4c264e9 View commit details
    Browse the repository at this point in the history
  25. WIP on Pixi v8 upgrade

    - commented out linebuilder for now
    - commented out dashed lines for now
    - a few changes in `drawShape()` -> `poly()`
    - new constructor for `PIXI.Geometry({options})`
    - pin version to v8.3.3
    - move `@esbuild/darwin-arm64` to optionalDependencies
    - still thinking about how to get texture atlases working
    bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    de61c72 View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    e82fb85 View commit details
    Browse the repository at this point in the history
  27. drawShape changed poly

    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    e2db882 View commit details
    Browse the repository at this point in the history
  28. Remove enum helpers for pixi line cap/joints, as v8 now just uses the…

    … raw string specifiers.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    52afe07 View commit details
    Browse the repository at this point in the history
  29. Fix a few issues- beginHole/endHole are replaced by the cut method, a…

    …nd maskSource now has a context, not a geometry.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    6ef1f17 View commit details
    Browse the repository at this point in the history
  30. fix the svgIconToTexture method to just do the symbol allocation with…

    …out using resource.load(), which no longer exists.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    39e932b View commit details
    Browse the repository at this point in the history
  31. Begin tackling the text-to-texture-allocator problem.

    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    62fa838 View commit details
    Browse the repository at this point in the history
  32. Comment out getLabelSprite as it relies on text objects having image …

    …data to obtain and allocate in the texture atlas. Bitmap text seems to work!
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    863d749 View commit details
    Browse the repository at this point in the history
  33. Fix a parent-setting bug that was preventing any AbstractFeatures fro…

    …m being added to parent containers.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    7733f73 View commit details
    Browse the repository at this point in the history
  34. Fix updateHitArea to use a rectangle, which is now one member of the …

    …local bounds returned by the sprite.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    99dbcaa View commit details
    Browse the repository at this point in the history
  35. Fix all PixiDashedLine draw invocations from 'drawSomething' to just …

    …'something'.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    c75f101 View commit details
    Browse the repository at this point in the history
  36. Change order of draw calls and swap setStrokeStyle() for just stroke(…

    …), lines now appear
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    e1b7f2c View commit details
    Browse the repository at this point in the history
  37. setStrokeStyle changes to stroke, beginFill changed to fill, drawCirc…

    …le changed to circle, name changed to label, drawRect changed to rect, drawPolygon changed to poly
    tannerwuster authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    2193f2b View commit details
    Browse the repository at this point in the history
  38. Get polygons working, but without the fills, which are causing stack …

    …traces.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    d875ec2 View commit details
    Browse the repository at this point in the history
  39. Fix the lasso drawing code by using poly() instead of polygon() and c…

    …orrecting the fill input.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    9bfd404 View commit details
    Browse the repository at this point in the history
  40. Update texture creation code so that fill() and stroke() methods are …

    …called after the geometry-creating methods.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    26d75d9 View commit details
    Browse the repository at this point in the history
  41. use graphicsContext to supply a hit target for lines

    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    0d66f29 View commit details
    Browse the repository at this point in the history
  42. Fix background imagery allocator to include the width and height of e…

    …ach allocated texture.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    98830c1 View commit details
    Browse the repository at this point in the history
  43. Fix stroke styles and get the atlas allocator quasi-working for just …

    …background tiles.
    Benjamin Clark authored and bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    8325c2e View commit details
    Browse the repository at this point in the history
  44. Fix typo

    bhousel committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    9f36993 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    82352d4 View commit details
    Browse the repository at this point in the history

Commits on Sep 18, 2024

  1. Update dependencies, pin to pixi 8.4.0

    Note that we do not need the submodules anymore
    (maybe we did not before either)
    `@pixi/util`, `@pixi/display`, `@pixi/graphics`, etc
    These things are all bundled in `pixijs`
    
    `@pixi/settings` is removed in v8
    bhousel committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    391c12b View commit details
    Browse the repository at this point in the history
  2. Update more of the graphic drawing methods to v8

    This is stuff like
    - drawCircle -> circle
    - drawRectangle -> rect
    - drawPolygon -> poly
    
    Also, be more consistent in how we import the Pixi objects,
    prefer just using the star import everywhere:
    `import * as PIXI from 'pixi.js';`
    bhousel committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    806de77 View commit details
    Browse the repository at this point in the history
  3. Revert the experimental code that was added to the tile layer

    This was unnecessary, the AtlasAllocator can continue to deal with
    whatever texture sources inputs we send it.
    bhousel committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    b2e43dc View commit details
    Browse the repository at this point in the history
  4. Skip the build worflow for this branch for now

    It won't work because:
        "@rapideditor/pixi-dashed-line": "file:../pixi-dashed-line",
        "@rapideditor/pixi-texture-allocator": "file:../pixi-texture-allocator",
    bhousel committed Sep 18, 2024
    Configuration menu
    Copy the full SHA
    6304197 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2024

  1. More Pixi v8 work, atlas textures seem to work now

    - Added several render options at init that might be helping
    - Commented out the `graphicToTexture code`
    - Several renames from `getChildByName` -> `getChildByLabel`
    
    Also, be more consistent in how we import the Pixi objects,
    prefer just using the star import everywhere:
     `import * as PIXI from 'pixi.js';`
    bhousel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    1ce0237 View commit details
    Browse the repository at this point in the history
  2. pixi 8.4.1

    bhousel committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    e353b8a View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2024

  1. Replace default ticker listener as before

    The variables are a little different in v8.
    This is still hacky, but I'm not sure another way around it.
    
    The `TickerPlugin` code that adds the Ticker to `PIXI.Application`
    really wants to do `ticker.add(this.render, this, UPDATE_PRIORITY.LOW);`
    even if we were to replace it with a different Ticker.
    
    Our issue is we need to call `render` ourselves at the time of our choosing.
    bhousel committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    39eba45 View commit details
    Browse the repository at this point in the history
  2. Update the svgIconToTexture method for v8.

    Benjamin Clark committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    8307eee View commit details
    Browse the repository at this point in the history

Commits on Sep 23, 2024

  1. WIP on textures and bitmap font issues

    Our texture atlases seem to be getting corrupted.  This will show up as either
    the Bitmap Fonts getting messed up, or leaking into the background tiles.
    
    I've tried commenting out the minimap for now, and also doing some other
    cleanups around the code to isolate whether textures are getting destroyed
    propertly.
    bhousel committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    665391e View commit details
    Browse the repository at this point in the history
  2. Replaced the AtlasAllocator code

    This switches from using `@rapideditor/pixi-texture-allocator`
    "fork of the plugin" to just including the code we need in Rapid.
    
    The old code worked ok for v7, but the v8 upgrade was causing texture
    corruption, and it became easier to just massively simplify things
    than to debug and fix whatever was going on with the plugin code.
    bhousel committed Sep 23, 2024
    Configuration menu
    Copy the full SHA
    3feb687 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2024

  1. Disable half pixel texture correction, as it now causes seams

    Also passing more options in the AtlasSource/TextureSource constructor,
    preferring to leave nothing to chance here.
    
    Also add some more comments and make sure everything has labels for
    better debug-ability.
    bhousel committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    8ca2a12 View commit details
    Browse the repository at this point in the history
  2. Rasterize the SVG icons by setting them onto an Image

    This is an older trick that I removed in dd24e91
    In pixi v7, we switched to using `SVGResource`, which did this for us
    In pixi v8, `SVGResource` is gone and there is now a SVG parser, but it
     doesn't fully support svg syntax, so we can go back to the old way for now.
    bhousel committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    1de84a0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b6aa505 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6c8992e View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2024

  1. Configuration menu
    Copy the full SHA
    299b6a3 View commit details
    Browse the repository at this point in the history
  2. Restore text labels!

    - Uncomments the `PixiLayerLabels` layer
    - Restores both bitmap text (ascii text placed next to pins)
      and textured text (complex text next to pins or along ropes)
    - Moves the text-to-texture code from `PixiLayerLabels.getLabelSprite()`
      to `PixiTextures.textToTexture()` in the texture manager
      (there are other functions in texture manager like this)
    
    Todo:
    - Polygon labels remain commented out because we need to calculate
      the buffer inside the perimeter.  We were (ab)using `PIXI.buildLine`
      for this, but maybe there is a better way now..
    
    Also:
    - There was previously some code in `PixiLayerLabels` that would do
      `toGlobal(position, point, true)` to skip updating the transform
      We can not pass `true` for `skipUpdate` anymore in pixi v8,
      Probably related to pixijs/pixijs#10433
    bhousel committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    d24aa79 View commit details
    Browse the repository at this point in the history
  3. Fix PIXI.buildLine() for v8 and restore perimeter area labels

    This was used before for calculating buffers around lines,
    which was used for hit testing and label placement.
    bhousel committed Sep 25, 2024
    Configuration menu
    Copy the full SHA
    18355f8 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2024

  1. Get dashed lines back to working for polygons/lines.

    Benjamin Clark committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    ad3710d View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2024

  1. Changes to support webGPU- move the UiDefs svg code to load after pix…

    …i has started, and change the allocator to send ImageBitmaps instead of raw pixel arrays.
    Benjamin Clark committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    8afe728 View commit details
    Browse the repository at this point in the history

Commits on Sep 28, 2024

  1. Got polygon partial fills working again

    I went back to doing things the old way:
    - Make a `PIXI.Graphic` using strokes,
      Then force generate it’s geometry,
      Then and extract the geometry into a `PIXI.Mesh`.
    
    The mesh works well for both hit testing and masking.
    
    Other approaches that didn't work:
    - In Pixi v8, stroke graphics can work for hit testing, but the
      hit test ignores `alignment` which we need when partial filling.
    
    - Tried using our `lineToPoly` buffer generating function
      to convert the stroke into a Graphic that would both hit test and mask,
      but it's too buggy. (it uses pixi's linebuilder, then walks the perimeter)
    bhousel committed Sep 28, 2024
    Configuration menu
    Copy the full SHA
    cb0809c View commit details
    Browse the repository at this point in the history