foundry-vtt-types icon indicating copy to clipboard operation
foundry-vtt-types copied to clipboard

Refactored `client/pixi/webgl/shaders/**`

Open esheyw opened this issue 1 year ago • 0 comments
trafficstars

Couple concerns:

  • Typed a lot of static override fragmentShader in subclasses as string | ((...args: any[]) => string) instead of just string, which matches the AbstractBaseShader typing, but I don't know if it's necessary if the subclass is providing a string. Went with what seemed 'more correct', in case there's further subclassing; fragmentShader is a method that takes args in a few places.
  • OccludableSamplerShader and DepthSamplerShader both provide @typedefs in the foundry code for extensions to PIXI.IBatchableElement, but if I try to change the signatures (_packInterleavedGeometry) that appear (they're just marked @inheritdoc, so there's inference here, but its pretty solid looking at the code) to take them instead of the parent type, TS doesn't like that: https://i.imgur.com/7Z92cDX.png
  • VisionMaskFilter tries to override the enabled property from PIXI.Filter with a getter (and a setter that does nothing). This is supposedly cleaned up according to Foundry #11050, so I'm leaving it with a slightly inaccurate typing and hoping it fixes itself in 12.329

esheyw avatar Jul 13 '24 23:07 esheyw